jBPM :: RuntimeManager 6.2.0.CR1

org.jbpm.runtime.manager.impl
Class PerRequestRuntimeManager

java.lang.Object
  extended by org.jbpm.runtime.manager.impl.AbstractRuntimeManager
      extended by org.jbpm.runtime.manager.impl.PerRequestRuntimeManager
All Implemented Interfaces:
org.kie.api.runtime.manager.RuntimeManager, org.kie.internal.runtime.manager.InternalRuntimeManager

public class PerRequestRuntimeManager
extends AbstractRuntimeManager

A RuntimeManager implementation that is backed by the "Per Request" strategy. This means that for every call to getRuntimeEngine, a new instance will be delivered with brand new KieSession and TaskService. The only exception to this is when this is invoked within the same transaction from different places. In that case, the manager caches the currently active instance in a ThreadLocal instane to avoid concurrent modifications or "loss" of data. Disposing of the runtime engine manager will ensure that it is destroyed as well, so that it will get removed from the database to avoid outdated data.
This implementation does not require any special Context to proceed.


Field Summary
 
Fields inherited from class org.jbpm.runtime.manager.impl.AbstractRuntimeManager
cacheManager, closed, deploymentDescriptor, engineInitEager, environment, identifier, registry, securityManager
 
Constructor Summary
PerRequestRuntimeManager(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
 void close()
           
 void disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeEngine runtime)
           
 org.kie.internal.runtime.manager.SessionFactory getFactory()
           
 org.kie.api.runtime.manager.RuntimeEngine getRuntimeEngine(org.kie.api.runtime.manager.Context<?> context)
           
 org.kie.internal.runtime.manager.TaskServiceFactory getTaskServiceFactory()
           
 void init()
           
 void setFactory(org.kie.internal.runtime.manager.SessionFactory factory)
           
 void setTaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)
           
 void validate(org.kie.api.runtime.KieSession ksession, org.kie.api.runtime.manager.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

PerRequestRuntimeManager

public PerRequestRuntimeManager(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)

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

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)

init

public void init()
Specified by:
init in class AbstractRuntimeManager

jBPM :: RuntimeManager 6.2.0.CR1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.