|
jBPM distribution 6.2.0.CR4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbpm.runtime.manager.impl.AbstractRuntimeManager
org.jbpm.runtime.manager.impl.SingletonRuntimeManager
public class SingletonRuntimeManager
This RuntimeManager is backed by a "Singleton" strategy, meaning that only one RuntimeEngine
instance will
exist for for the given RuntimeManager instance. The RuntimeEngine will be synchronized to make sure it will work
properly in multi-threaded environments. However, this might cause some performance issues due to sequential execution.
An important aspect of this manager is that it will persists it's identifier as a temporary file to keep track of the
KieSession
it was using to maintain its state: for example, the session state including (drools) facts, etc.
The mentioned file is named as follows:
manager.getIdentifier()-jbpmSessionId.ser
For example, for default named manager it will be:
default-singleton-jbpmSessionId.ser
The location of the file will be one of the following, it is resolved in below order:
Field Summary |
---|
Fields inherited from class org.jbpm.runtime.manager.impl.AbstractRuntimeManager |
---|
cacheManager, closed, deploymentDescriptor, engineInitEager, environment, identifier, registry, securityManager |
Constructor Summary | |
---|---|
SingletonRuntimeManager()
|
|
SingletonRuntimeManager(RuntimeEnvironment environment,
org.kie.internal.runtime.manager.SessionFactory factory,
org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory,
String identifier)
|
Method Summary | |
---|---|
void |
close()
Closes RuntimeManager and releases it's resources. |
void |
disposeRuntimeEngine(RuntimeEngine runtime)
Disposes RuntimeEngine and notifies all listeners about that fact. |
org.kie.internal.runtime.manager.SessionFactory |
getFactory()
|
protected String |
getLocation()
|
protected Long |
getPersistedSessionId(String location,
String identifier)
Retrieves session id from serialized file named jbpmSessionId.ser from given location. |
RuntimeEngine |
getRuntimeEngine(Context context)
Returns RuntimeEngine instance that is fully initialized:
KiseSession is created or loaded depending on the strategy
TaskService is initialized and attached to ksession (via listener)
WorkItemHandlers are initialized and registered on ksession
EventListeners (process, agenda, working memory) are initialized and added to ksession
|
org.kie.internal.runtime.manager.TaskServiceFactory |
getTaskServiceFactory()
|
void |
init()
|
protected void |
persistSessionId(String location,
String identifier,
Long ksessionId)
Stores gives ksessionId in a serialized file in given location under jbpmSessionId.ser file name |
void |
setFactory(org.kie.internal.runtime.manager.SessionFactory factory)
|
void |
setTaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)
|
void |
validate(KieSession ksession,
Context<?> context)
|
Methods inherited from class org.jbpm.runtime.manager.impl.AbstractRuntimeManager |
---|
attachManager, canDestroy, checkPermission, close, configureRuntimeOnTaskService, getCacheManager, getDeploymentDescriptor, getEnvironment, getIdentifier, getTransactionManager, hasEnvironmentEntry, isClosed, registerDisposeCallback, registerItems, removeRuntimeFromTaskService, setCacheManager, setDeploymentDescriptor, setEnvironment, setIdentifier, setSecurityManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SingletonRuntimeManager()
public SingletonRuntimeManager(RuntimeEnvironment environment, org.kie.internal.runtime.manager.SessionFactory factory, org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory, String identifier)
Method Detail |
---|
public void init()
init
in class AbstractRuntimeManager
public RuntimeEngine getRuntimeEngine(Context context)
RuntimeManager
RuntimeEngine
instance that is fully initialized:
context
- the concrete implementation of the context that is supported by given RuntimeManager
RuntimeEngine
public void validate(KieSession ksession, Context<?> context) throws IllegalStateException
IllegalStateException
public void disposeRuntimeEngine(RuntimeEngine runtime)
RuntimeManager
RuntimeEngine
and notifies all listeners about that fact.
This method should always be used to dispose RuntimeEngine
that is not needed
anymore. RuntimeEngine
was obtained within active JTA transaction,
this means that when getRuntimeEngine method was invoked during active JTA transaction then dispose of
the runtime engine will happen automatically on transaction completion.
public void close()
RuntimeManager
RuntimeManager
and releases it's resources. Shall always be called when
runtime manager is not needed any more. Otherwise it will still be active and operational.
close
in interface RuntimeManager
close
in class AbstractRuntimeManager
protected Long getPersistedSessionId(String location, String identifier)
location
- directory where jbpmSessionId.ser file should beidentifier
- of the manager owning this ksessionId
protected void persistSessionId(String location, String identifier, Long ksessionId)
location
- directory where serialized file should be storedidentifier
- of the manager owning this ksessionIdksessionId
- value of ksessionId to be storedprotected String getLocation()
public org.kie.internal.runtime.manager.SessionFactory getFactory()
public void setFactory(org.kie.internal.runtime.manager.SessionFactory factory)
public org.kie.internal.runtime.manager.TaskServiceFactory getTaskServiceFactory()
public void setTaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)
|
jBPM distribution 6.2.0.CR4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |