Package org.jbpm.kie.services.impl

## Class AbstractDeploymentService

- java.lang.Object
- - org.jbpm.kie.services.impl.AbstractDeploymentService

- All Implemented Interfaces:
    `DeploymentService`, `ListenerSupport`
  Direct Known Subclasses:
    `KModuleDeploymentService`

      public abstract class AbstractDeploymentService
      extends Object
      implements DeploymentService, ListenerSupport

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Map<String,​DeployedUnit>` | `deploymentsMap` |
    `protected javax.persistence.EntityManagerFactory` | `emf` |
    `protected org.kie.internal.identity.IdentityProvider` | `identityProvider` |
    `protected Set<DeploymentEventListener>` | `listeners` |
    `protected org.kie.api.runtime.manager.RuntimeManagerFactory` | `managerFactory` |
    `protected RuntimeDataService` | `runtimeDataService` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractDeploymentService()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addListener​(DeploymentEventListener listener)` | Adds a new deployment listener.
    `void` | `commonDeploy​(DeploymentUnit unit, DeployedUnitImpl deployedUnit, org.kie.api.runtime.manager.RuntimeEnvironment environemnt, org.kie.api.runtime.KieContainer kieContainer)` |
    `void` | `deploy​(DeploymentUnit unit)` | Performs deployment operation of given `unit`.
    `DeployedUnit` | `getDeployedUnit​(String deploymentUnitId)` | Returns `DeployedUnit` instance for given deployment id if exists
    `Collection<DeployedUnit>` | `getDeployedUnits()` | Returns all (currently) deployed units.
    `Map<String,​DeployedUnit>` | `getDeploymentsMap()` |
    `javax.persistence.EntityManagerFactory` | `getEmf()` |
    `Collection<DeploymentEventListener>` | `getListeners()` | Returns all deployment listeners
    `org.kie.api.runtime.manager.RuntimeManagerFactory` | `getManagerFactory()` |
    `RuntimeDataService` | `getRuntimeDataService()` |
    `org.kie.api.runtime.manager.RuntimeManager` | `getRuntimeManager​(String deploymentUnitId)` | Returns `RuntimeManager` instance dedicated to deployment unit identified by given id
    `boolean` | `isDeployed​(String deploymentUnitId)` | Performs a check if given deployment is already active
    `void` | `notifyOnActivate​(DeploymentUnit unit, DeployedUnit deployedUnit)` |
    `void` | `notifyOnDeactivate​(DeploymentUnit unit, DeployedUnit deployedUnit)` |
    `void` | `notifyOnDeploy​(DeploymentUnit unit, DeployedUnit deployedUnit)` |
    `void` | `notifyOnUnDeploy​(DeploymentUnit unit, DeployedUnit deployedUnit)` |
    `void` | `removeListener​(DeploymentEventListener listener)` | Removes an existing deployment listener.
    `void` | `setEmf​(javax.persistence.EntityManagerFactory emf)` |
    `void` | `setIdentityProvider​(org.kie.internal.identity.IdentityProvider identityProvider)` |
    `void` | `setManagerFactory​(org.kie.api.runtime.manager.RuntimeManagerFactory managerFactory)` |
    `void` | `setRuntimeDataService​(RuntimeDataService runtimeDataService)` |
    `protected AuditEventBuilder` | `setupAuditLogger​(org.kie.internal.identity.IdentityProvider identityProvider, String deploymentUnitId)` |
    `void` | `shutdown()` |
    `void` | `undeploy​(DeploymentUnit unit)` | Performs undeployment operation of given `unit`.
    `void` | `undeploy​(DeploymentUnit unit, Function<DeploymentUnit,​Boolean> beforeUndeploy)` | Performs undeployment operation of given `unit` aborting existing process instances if needed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.jbpm.services.api.DeploymentService

      `activate, deactivate`

- - ### Field Detail

    - #### managerFactory

          protected org.kie.api.runtime.manager.RuntimeManagerFactory managerFactory

    - #### runtimeDataService

          protected RuntimeDataService runtimeDataService

    - #### emf

          protected javax.persistence.EntityManagerFactory emf

    - #### identityProvider

          protected org.kie.internal.identity.IdentityProvider identityProvider

    - #### listeners

          protected Set<DeploymentEventListener> listeners

    - #### deploymentsMap

          protected Map<String,​DeployedUnit> deploymentsMap

  - ### Constructor Detail

    - #### AbstractDeploymentService

          public AbstractDeploymentService()

  - ### Method Detail

    - #### addListener

          public void addListener​(DeploymentEventListener listener)

      Description copied from interface: `ListenerSupport`
      Adds a new deployment listener.
      Specified by:
        `addListener` in interface `ListenerSupport`

    - #### removeListener

          public void removeListener​(DeploymentEventListener listener)

      Description copied from interface: `ListenerSupport`
      Removes an existing deployment listener.
      Specified by:
        `removeListener` in interface `ListenerSupport`

    - #### getListeners

          public Collection<DeploymentEventListener> getListeners()

      Description copied from interface: `ListenerSupport`
      Returns all deployment listeners
      Specified by:
        `getListeners` in interface `ListenerSupport`
      Returns:
        deployment listeners

    - #### deploy

          public void deploy​(DeploymentUnit unit)

      Description copied from interface: `DeploymentService`
      Performs deployment operation of given `unit`.
      Specified by:
        `deploy` in interface `DeploymentService`
      Parameters:
        `unit` - deployment unit to be deployed to runtime

    - #### notifyOnDeploy

          public void notifyOnDeploy​(DeploymentUnit unit,
                                     DeployedUnit deployedUnit)

    - #### notifyOnUnDeploy

          public void notifyOnUnDeploy​(DeploymentUnit unit,
                                       DeployedUnit deployedUnit)

    - #### notifyOnActivate

          public void notifyOnActivate​(DeploymentUnit unit,
                                       DeployedUnit deployedUnit)

    - #### notifyOnDeactivate

          public void notifyOnDeactivate​(DeploymentUnit unit,
                                         DeployedUnit deployedUnit)

    - #### commonDeploy

          public void commonDeploy​(DeploymentUnit unit,
                                   DeployedUnitImpl deployedUnit,
                                   org.kie.api.runtime.manager.RuntimeEnvironment environemnt,
                                   org.kie.api.runtime.KieContainer kieContainer)

    - #### undeploy

          public void undeploy​(DeploymentUnit unit)

      Description copied from interface: `DeploymentService`
      Performs undeployment operation of given `unit`.
      Specified by:
        `undeploy` in interface `DeploymentService`
      Parameters:
        `unit` - deployment unit to be undeployed from runtime

    - #### undeploy

          public void undeploy​(DeploymentUnit unit,
                               Function<DeploymentUnit,​Boolean> beforeUndeploy)

      Description copied from interface: `DeploymentService`
      Performs undeployment operation of given `unit` aborting existing process instances if needed.
      Specified by:
        `undeploy` in interface `DeploymentService`
      Parameters:
        `unit` - deployment unit to be undeployed from runtime
        `beforeUndeploy` - a function to run custom actions before undeploying a given `DeploymentUnit` . It should return if the unit can be deployed or not determining if the deployment can continue.

    - #### getRuntimeManager

          public org.kie.api.runtime.manager.RuntimeManager getRuntimeManager​(String deploymentUnitId)

      Description copied from interface: `DeploymentService`
      Returns `RuntimeManager` instance dedicated to deployment unit identified by given id
      Specified by:
        `getRuntimeManager` in interface `DeploymentService`
      Parameters:
        `deploymentUnitId` - identifier of deployment unit
      Returns:
        `RuntimeManager` if exists for given deployment id otherwise null

    - #### getDeployedUnit

          public DeployedUnit getDeployedUnit​(String deploymentUnitId)

      Description copied from interface: `DeploymentService`
      Returns `DeployedUnit` instance for given deployment id if exists
      Specified by:
        `getDeployedUnit` in interface `DeploymentService`
      Parameters:
        `deploymentUnitId` - identifier of deployment unit
      Returns:
        `DeployedUnit` instance if exists for given deployment id otherwise null

    - #### getDeploymentsMap

          public Map<String,​DeployedUnit> getDeploymentsMap()

    - #### getDeployedUnits

          public Collection<DeployedUnit> getDeployedUnits()

      Description copied from interface: `DeploymentService`
      Returns all (currently) deployed units.
      Specified by:
        `getDeployedUnits` in interface `DeploymentService`
      Returns:
        collections of all existing deployed units

    - #### getManagerFactory

          public org.kie.api.runtime.manager.RuntimeManagerFactory getManagerFactory()

    - #### setManagerFactory

          public void setManagerFactory​(org.kie.api.runtime.manager.RuntimeManagerFactory managerFactory)

    - #### getRuntimeDataService

          public RuntimeDataService getRuntimeDataService()

    - #### getEmf

          public javax.persistence.EntityManagerFactory getEmf()

    - #### setEmf

          public void setEmf​(javax.persistence.EntityManagerFactory emf)

    - #### setRuntimeDataService

          public void setRuntimeDataService​(RuntimeDataService runtimeDataService)

    - #### setIdentityProvider

          public void setIdentityProvider​(org.kie.internal.identity.IdentityProvider identityProvider)

    - #### setupAuditLogger

          protected AuditEventBuilder setupAuditLogger​(org.kie.internal.identity.IdentityProvider identityProvider,
                                                       String deploymentUnitId)

    - #### isDeployed

          public boolean isDeployed​(String deploymentUnitId)

      Description copied from interface: `DeploymentService`
      Performs a check if given deployment is already active
      Specified by:
        `isDeployed` in interface `DeploymentService`
      Returns:
        true if deployment is active, false if not

    - #### shutdown

          public void shutdown()