org.jbpm.runtime.manager.impl

## Class AbstractRuntimeManager

- java.lang.Object
- - org.jbpm.runtime.manager.impl.AbstractRuntimeManager

- All Implemented Interfaces:
    org.kie.api.runtime.manager.RuntimeManager, org.kie.internal.runtime.manager.InternalRuntimeManager
  Direct Known Subclasses:
    PerProcessInstanceRuntimeManager, PerRequestRuntimeManager, SingletonRuntimeManager

      public abstract class AbstractRuntimeManager
      extends Object
      implements org.kie.internal.runtime.manager.InternalRuntimeManager

  Common implementation that all `RuntimeManager` implementations should inherit from. Provides the following capabilities:
  - keeps track of all active managers by their identifier and prevents multiple managers from having the same id
  - provides a common close operation
  - injects the RuntimeManager into the ksession's environment for further reference
  - registers dispose callbacks (via transaction synchronization) to dispose of the runtime engine automatically on transaction completion
  - registers all defined items (work item handlers, event listeners)
  Additionally, this provides a abstract `init` method that will be called on RuntimeManager instantiation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.kie.internal.runtime.manager.CacheManager` | `cacheManager`
    `protected boolean` | `closed`
    `protected org.kie.internal.runtime.conf.DeploymentDescriptor` | `deploymentDescriptor`
    `protected boolean` | `engineInitEager`
    `protected org.kie.api.runtime.manager.RuntimeEnvironment` | `environment`
    `protected String` | `identifier`
    `protected org.kie.api.runtime.KieContainer` | `kieContainer`
    `protected org.kie.internal.runtime.manager.RuntimeManagerRegistry` | `registry`
    `protected org.kie.internal.runtime.manager.SecurityManager` | `securityManager`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractRuntimeManager(org.kie.api.runtime.manager.RuntimeEnvironment environment, String identifier)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `attachManager(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected boolean` | `canDestroy(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected boolean` | `canDispose(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected void` | `checkPermission()`
    `void` | `close()`
    `void` | `close(boolean removeJobs)`
    `protected void` | `configureRuntimeOnTaskService(org.kie.internal.task.api.InternalTaskService internalTaskService, org.kie.api.runtime.manager.RuntimeEngine engine)`
    `org.kie.internal.runtime.manager.CacheManager` | `getCacheManager()`
    `org.kie.internal.runtime.conf.DeploymentDescriptor` | `getDeploymentDescriptor()`
    `org.kie.internal.runtime.manager.RuntimeEnvironment` | `getEnvironment()`
    `String` | `getIdentifier()`
    `org.kie.api.runtime.KieContainer` | `getKieContainer()`
    `protected org.drools.persistence.TransactionManager` | `getTransactionManager(org.kie.api.runtime.Environment env)`
    `protected boolean` | `hasEnvironmentEntry(String name, Object value)`
    `abstract void` | `init()`
    `boolean` | `isClosed()`
    `protected void` | `registerDisposeCallback(org.kie.api.runtime.manager.RuntimeEngine runtime, org.drools.persistence.TransactionSynchronization sync)`
    `protected void` | `registerItems(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected void` | `removeRuntimeFromTaskService()`
    `void` | `setCacheManager(org.kie.internal.runtime.manager.CacheManager cacheManager)`
    `void` | `setDeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor deploymentDescriptor)`
    `void` | `setEnvironment(org.kie.api.runtime.manager.RuntimeEnvironment environment)`
    `void` | `setIdentifier(String identifier)`
    `void` | `setKieContainer(org.kie.api.runtime.KieContainer kieContainer)`
    `void` | `setSecurityManager(org.kie.internal.runtime.manager.SecurityManager securityManager)`

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

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

    - ### Methods inherited from interface org.kie.internal.runtime.manager.InternalRuntimeManager

      `validate`

    - ### Methods inherited from interface org.kie.api.runtime.manager.RuntimeManager

      `disposeRuntimeEngine, getRuntimeEngine, signalEvent`

- - ### Field Detail

    - #### registry

          protected org.kie.internal.runtime.manager.RuntimeManagerRegistry registry

    - #### environment

          protected org.kie.api.runtime.manager.RuntimeEnvironment environment

    - #### deploymentDescriptor

          protected org.kie.internal.runtime.conf.DeploymentDescriptor deploymentDescriptor

    - #### kieContainer

          protected org.kie.api.runtime.KieContainer kieContainer

    - #### cacheManager

          protected org.kie.internal.runtime.manager.CacheManager cacheManager

    - #### engineInitEager

          protected boolean engineInitEager

    - #### identifier

          protected String identifier

    - #### closed

          protected boolean closed

    - #### securityManager

          protected org.kie.internal.runtime.manager.SecurityManager securityManager

  - ### Constructor Detail

    - #### AbstractRuntimeManager

          public AbstractRuntimeManager(org.kie.api.runtime.manager.RuntimeEnvironment environment,
                                String identifier)

  - ### Method Detail

    - #### init

          public abstract void init()

    - #### registerItems

          protected void registerItems(org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### registerDisposeCallback

          protected void registerDisposeCallback(org.kie.api.runtime.manager.RuntimeEngine runtime,
                                     org.drools.persistence.TransactionSynchronization sync)

    - #### canDispose

          protected boolean canDispose(org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### attachManager

          protected void attachManager(org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### isClosed

          public boolean isClosed()

      Specified by:
        `isClosed` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### close

          public void close()

      Specified by:
        `close` in interface `org.kie.api.runtime.manager.RuntimeManager`

    - #### close

          public void close(boolean removeJobs)

    - #### getEnvironment

          public org.kie.internal.runtime.manager.RuntimeEnvironment getEnvironment()

      Specified by:
        `getEnvironment` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### setEnvironment

          public void setEnvironment(org.kie.api.runtime.manager.RuntimeEnvironment environment)

    - #### getIdentifier

          public String getIdentifier()

      Specified by:
        `getIdentifier` in interface `org.kie.api.runtime.manager.RuntimeManager`

    - #### setIdentifier

          public void setIdentifier(String identifier)

    - #### configureRuntimeOnTaskService

          protected void configureRuntimeOnTaskService(org.kie.internal.task.api.InternalTaskService internalTaskService,
                                           org.kie.api.runtime.manager.RuntimeEngine engine)

    - #### removeRuntimeFromTaskService

          protected void removeRuntimeFromTaskService()

    - #### canDestroy

          protected boolean canDestroy(org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### hasEnvironmentEntry

          protected boolean hasEnvironmentEntry(String name,
                                    Object value)

    - #### getTransactionManager

          protected org.drools.persistence.TransactionManager getTransactionManager(org.kie.api.runtime.Environment env)

    - #### getDeploymentDescriptor

          public org.kie.internal.runtime.conf.DeploymentDescriptor getDeploymentDescriptor()

      Specified by:
        `getDeploymentDescriptor` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### setDeploymentDescriptor

          public void setDeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor deploymentDescriptor)

      Specified by:
        `setDeploymentDescriptor` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### setSecurityManager

          public void setSecurityManager(org.kie.internal.runtime.manager.SecurityManager securityManager)

      Specified by:
        `setSecurityManager` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### checkPermission

          protected void checkPermission()

    - #### setCacheManager

          public void setCacheManager(org.kie.internal.runtime.manager.CacheManager cacheManager)

      Specified by:
        `setCacheManager` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### getCacheManager

          public org.kie.internal.runtime.manager.CacheManager getCacheManager()

      Specified by:
        `getCacheManager` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### getKieContainer

          public org.kie.api.runtime.KieContainer getKieContainer()

      Specified by:
        `getKieContainer` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

    - #### setKieContainer

          public void setKieContainer(org.kie.api.runtime.KieContainer kieContainer)

      Specified by:
        `setKieContainer` in interface `org.kie.internal.runtime.manager.InternalRuntimeManager`

Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.