Interface EPDeploymentService


public interface EPDeploymentService
Service for deploying and undeploying modules and obtaining information about current deployments and statements.
  • Method Details

    • deploy

      EPDeployment deploy(EPCompiled compiled) throws EPDeployException
      Deploy a compiled module and with the default options.
      Parameters:
      compiled - byte code
      Returns:
      deployment
      Throws:
      EPDeployException - when the deployment failed
    • deploy

      EPDeployment deploy(EPCompiled compiled, DeploymentOptions options) throws EPDeployException
      Deploy a compiled module and with the provided options.
      Parameters:
      compiled - byte code
      options - deployment options
      Returns:
      deployment
      Throws:
      EPDeployException - when the deployment failed
    • getDeployments

      String[] getDeployments()
      Returns the deployment ids of all deployments.
      Returns:
      deployment ids
    • undeploy

      void undeploy(String deploymentId) throws EPUndeployException
      Undeploy a deployment and with the default options.
      Parameters:
      deploymentId - of the deployment to undeploy
      Throws:
      EPUndeployException - when the deployment does not exist or the undeployment failed and the deployment remains deployed
    • undeploy

      void undeploy(String deploymentId, UndeploymentOptions options) throws EPUndeployException
      Undeploy a deployment and with the provided options
      Parameters:
      deploymentId - of the deployment to undeploy
      options - undeployment options
      Throws:
      EPUndeployException - when the deployment does not exist or the undeployment failed and the deployment remains deployed
    • undeployAll

      void undeployAll() throws EPUndeployException
      Undeploy all deployments and with the default options.

      Does not un-deploy staged deployments.

      Throws:
      EPUndeployException - when the undeployment failed, of the deployments may remain deployed
    • undeployAll

      void undeployAll(UndeploymentOptions options) throws EPUndeployException
      Undeploy all deployments and with the provided options.
      Parameters:
      options - undeployment options or null if none provided
      Throws:
      EPUndeployException - when the undeployment failed, of the deployments may remain deployed
    • getStatement

      EPStatement getStatement(String deploymentId, String statementName)
      Returns the statement of a given deployment.

      A statement is uniquely identified by the deployment id that deployed the statement and by the statement name.

      Parameters:
      deploymentId - deployment id of the statement
      statementName - statement name
      Returns:
      statement or null if the statement could not be found
    • getDeployment

      EPDeployment getDeployment(String deploymentId)
      Returns the deployment.

      A deployment is uniquely identified by its deployment id.

      Parameters:
      deploymentId - the deployment id of the deployment
      Returns:
      deployment or null if the deployment could not be found
    • addDeploymentStateListener

      void addDeploymentStateListener(DeploymentStateListener listener)
      Add a deployment state listener
      Parameters:
      listener - to add
    • removeDeploymentStateListener

      void removeDeploymentStateListener(DeploymentStateListener listener)
      Remove a deployment state listener
      Parameters:
      listener - to remove
    • getDeploymentStateListeners

      Iterator<DeploymentStateListener> getDeploymentStateListeners()
      Returns an iterator of deployment state listeners (read-only)
      Returns:
      listeners
    • removeAllDeploymentStateListeners

      void removeAllDeploymentStateListeners()
      Removes all deployment state listener
    • isDeployed

      boolean isDeployed(String deploymentId)
      Returns indicator whether a deployment for this deployment id exists
      Parameters:
      deploymentId - deployment id
      Returns:
      true for deployed, false for not deployed
    • rollout

      Roll-out multiple deployments. See rollout(Collection, RolloutOptions).
      Parameters:
      items - compiled units and deployment options
      Returns:
      deployment
      Throws:
      EPDeployException - when any of the deployments failed
    • rollout

      Roll-out multiple deployments.

      Deploys each compiled module, either deploying all compilation units or deploying none of the compilation units.

      Does not reorder compilation units and expects compilation units to be ordered according to module dependencies (if any).

      The step-by-step is as allows:

      1. For each compilation unit, determine the deployment id or use the deployment id when provided in the deployment options; Check that all deployment ids do not already exist
      2. For each compilation unit, load compilation unit via classloader and validate basic class-related information such as manifest information and version
      3. For each compilation unit, check deployment preconditions and resolve deployment dependencies on EPL objects
      4. For each compilation unit, initialize statement-internal objects
      5. For each compilation unit, perform internal deployment of each statement of each module

      In case any of the above steps fail the runtime completely rolls back all changes.

      Parameters:
      items - compiled units and deployment options
      options - rollout options
      Returns:
      deployment
      Throws:
      EPDeployException - when any of the deployments failed
    • getDeploymentDependenciesProvided

      EPDeploymentDependencyProvided getDeploymentDependenciesProvided(String deploymentId) throws EPException
      Obtain information about other deployments that are depending on the given deployment, i.e. EPL objects that this deployment provides to other deployments. This method acquires the runtime-wide event processing read lock for the duration. Does not return dependencies on predefined EPL objects such as configured event types or variables. Does not return deployment-internal dependencies i.e. dependencies on EPL objects that are defined by the same deployment.
      Parameters:
      deploymentId - deployment id
      Returns:
      dependencies or null if the deployment is not found
      Throws:
      EPException - when the required lock cannot be obtained
    • getDeploymentDependenciesConsumed

      EPDeploymentDependencyConsumed getDeploymentDependenciesConsumed(String deploymentId) throws EPException
      Obtain information about the dependencies that the given deployment has on other deployments, i.e. EPL objects that this deployment consumes from other deployments. This method acquires the runtime-wide event processing read lock for the duration. Does not return dependencies on predefined EPL objects such as configured event types or variables. Does not return deployment-internal dependencies i.e. dependencies on EPL objects that are defined by the same deployment.
      Parameters:
      deploymentId - deployment id
      Returns:
      dependencies or null if the deployment is not found
      Throws:
      EPException - when the required lock cannot be obtained