org.jbpm.runtime.manager.impl

## Class PerProcessInstanceRuntimeManager

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

- All Implemented Interfaces:
    org.kie.api.runtime.manager.RuntimeManager, org.kie.internal.runtime.manager.InternalRuntimeManager

      public class PerProcessInstanceRuntimeManager
      extends AbstractRuntimeManager

  A RuntimeManager implementation that is backed by the "Per Process Instance" strategy. This means that every process instance will be bound to a ksession for it's entire life time. Once started, whenever other operations are invoked, this manager will ensure that the correct ksession will be provided.
  This also applies to sub processes (reusable sub processes) that create new process instances: the sub process instance will have its own ksession independent of the parent one.
  This manager will ensure that as soon as the process instance completes, the ksession will be disposed of and destroyed.
  This implementation supports the following `Context` implementations:
  - ProcessInstanceIdContext
  - CorrelationKeyContext
  - EmptyContext - for initial RuntimeEngine to start process only

- - ### Field Summary

    - ### Fields inherited from class org.jbpm.runtime.manager.impl.AbstractRuntimeManager

      `cacheManager, closed, deploymentDescriptor, engineInitEager, environment, identifier, kieContainer, registry, securityManager`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerProcessInstanceRuntimeManager(org.kie.api.runtime.manager.RuntimeEnvironment environment, org.kie.internal.runtime.manager.SessionFactory factory, org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory, String identifier)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected org.kie.api.runtime.manager.RuntimeEngine` | `findLocalRuntime(Object processInstanceId)`
    `org.kie.internal.runtime.manager.SessionFactory` | `getFactory()`
    `org.kie.internal.runtime.manager.Mapper` | `getMapper()`
    `org.kie.api.runtime.manager.RuntimeEngine` | `getRuntimeEngine(org.kie.api.runtime.manager.Context<?> context)`
    `org.kie.internal.runtime.manager.TaskServiceFactory` | `getTaskServiceFactory()`
    `void` | `init()`
    `protected void` | `removeLocalRuntime(org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `protected void` | `saveLocalRuntime(Object processInstanceId, org.kie.api.runtime.manager.RuntimeEngine runtime)`
    `void` | `setFactory(org.kie.internal.runtime.manager.SessionFactory factory)`
    `void` | `setMapper(org.kie.internal.runtime.manager.Mapper mapper)`
    `void` | `setTaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)`
    `void` | `signalEvent(String type, Object event)`
    `void` | `validate(org.kie.api.runtime.KieSession ksession, org.kie.api.runtime.manager.Context<?> context)`
    `boolean` | `validate(Long ksessionId, Long processInstanceId)`

    - ### Methods inherited from class org.jbpm.runtime.manager.impl.AbstractRuntimeManager

      `attachManager, canDestroy, canDispose, checkPermission, close, configureRuntimeOnTaskService, getCacheManager, getDeploymentDescriptor, getEnvironment, getIdentifier, getKieContainer, getTransactionManager, hasEnvironmentEntry, isClosed, registerDisposeCallback, registerItems, removeRuntimeFromTaskService, setCacheManager, setDeploymentDescriptor, setEnvironment, setIdentifier, setKieContainer, setSecurityManager`

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

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

- - ### Constructor Detail

    - #### PerProcessInstanceRuntimeManager

          public PerProcessInstanceRuntimeManager(org.kie.api.runtime.manager.RuntimeEnvironment environment,
                                          org.kie.internal.runtime.manager.SessionFactory factory,
                                          org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory,
                                          String identifier)

  - ### Method Detail

    - #### getRuntimeEngine

          public org.kie.api.runtime.manager.RuntimeEngine getRuntimeEngine(org.kie.api.runtime.manager.Context<?> context)

    - #### signalEvent

          public void signalEvent(String type,
                         Object event)

    - #### validate

          public void validate(org.kie.api.runtime.KieSession ksession,
                      org.kie.api.runtime.manager.Context<?> context)
                        throws IllegalStateException

      Throws:
        `IllegalStateException`

    - #### disposeRuntimeEngine

          public void disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### close

          public void close()

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

    - #### validate

          public boolean validate(Long ksessionId,
                         Long processInstanceId)

    - #### getFactory

          public org.kie.internal.runtime.manager.SessionFactory getFactory()

    - #### setFactory

          public void setFactory(org.kie.internal.runtime.manager.SessionFactory factory)

    - #### getTaskServiceFactory

          public org.kie.internal.runtime.manager.TaskServiceFactory getTaskServiceFactory()

    - #### setTaskServiceFactory

          public void setTaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)

    - #### getMapper

          public org.kie.internal.runtime.manager.Mapper getMapper()

    - #### setMapper

          public void setMapper(org.kie.internal.runtime.manager.Mapper mapper)

    - #### findLocalRuntime

          protected org.kie.api.runtime.manager.RuntimeEngine findLocalRuntime(Object processInstanceId)

    - #### saveLocalRuntime

          protected void saveLocalRuntime(Object processInstanceId,
                              org.kie.api.runtime.manager.RuntimeEngine runtime)

    - #### removeLocalRuntime

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

    - #### init

          public void init()

      Specified by:
        `init` in class `AbstractRuntimeManager`

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