org.jbpm.pvm.internal.processengine
Class ProcessEngineImpl

java.lang.Object
  extended by org.jbpm.pvm.internal.processengine.ProcessEngineImpl
All Implemented Interfaces:
java.io.Serializable, ProcessEngine, Context, EnvironmentFactory
Direct Known Subclasses:
SpringProcessEngine

public class ProcessEngineImpl
extends java.lang.Object
implements Context, ProcessEngine, EnvironmentFactory, java.io.Serializable

an environment factory that also is the process-engine context.

This environment factory will produce environments with 2 contexts: the process-engine context and the block context.

An process-engine context is build from two wire definitions: the process-engine wire definition and the environment wire definition.

The process-engine context itself is build from the process-engine wire definition. So all objects that are created in this context remain cached for the lifetime of this process-engine context object.

This process-engine context is also a environment factory. The produced environments contain 2 contexts: the process-engine context itself and a new environment context, build from the environment wire definition. For each created environment, a new environment context will be created from the same environment wire definition. Objects in the environment context will live for as long as the environment.

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected  java.lang.ThreadLocal<java.lang.String> authenticatedUserIdThreadLocal
           
static java.lang.String JBPM_LIBRARY_VERSION
           
protected  WireContext processEngineWireContext
           
protected  WireDefinition transactionWireDefinition
           
protected  CommandService userCommandService
           
protected  java.lang.ThreadLocal<java.util.List<UserProvidedEnvironmentObject>> userProvidedEnvironmentObjectsThreadLocal
           
 
Fields inherited from interface org.jbpm.pvm.internal.env.Context
CONTEXTNAME_EXECUTION, CONTEXTNAME_JOB, CONTEXTNAME_PROCESS_ENGINE, CONTEXTNAME_TASK, CONTEXTNAME_TRANSACTION
 
Constructor Summary
ProcessEngineImpl()
           
ProcessEngineImpl(ConfigurationImpl configuration)
           
 
Method Summary
 void addProcessEngineWireDefinition(WireDefinition wireDefinition)
           
 void addTransactionWireDefinition(WireDefinition wireDefinition)
           
protected  void addUserProvidedEnvironmentObject(UserProvidedEnvironmentObject userProvidedEnvironmentObject)
           
protected  void checkDb(ConfigurationImpl configuration)
           
 void close()
          closes this environment factory and cleans any allocated resources.
<T> T
execute(Command<T> command)
           
<T> T
get(java.lang.Class<T> type)
           
 java.lang.Object get(java.lang.String key)
           
 ExecutionService getExecutionService()
           
 HistoryService getHistoryService()
           
 IdentityService getIdentityService()
           
 ManagementService getManagementService()
           
 java.lang.String getName()
           
 WireContext getProcessEngineWireContext()
           
 RepositoryService getRepositoryService()
           
 TaskService getTaskService()
           
 WireDefinition getTransactionWireDefinition()
           
 boolean has(java.lang.String key)
           
protected  void initializeProcessEngine(ConfigurationImpl configuration)
           
protected  void installAuthenticatedUserId(EnvironmentImpl environment)
           
protected  void installProcessEngineContext(PvmEnvironment environment)
           
protected  void installTransactionContext(PvmEnvironment environment)
           
 java.util.Set<java.lang.String> keys()
           
 EnvironmentImpl openEnvironment()
          open a new EnvironmentImpl.
static EnvironmentFactory parseXmlString(java.lang.String jbpmConfigurationXml)
           
 java.lang.Object set(java.lang.String key, java.lang.Object value)
           
 ProcessEngine setAuthenticatedUserId(java.lang.String authenticatedUserId)
           
 ProcessEngine setHibernateSession(java.lang.Object hibernateSession)
           
 ProcessEngine setJdbcConnection(java.sql.Connection jdbcConnection)
           
 void setProcessEngineWireContext(WireContext processEngineWireContext)
           
 void setTransactionWireDefinition(WireDefinition transactionWireDefinition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JBPM_LIBRARY_VERSION

public static final java.lang.String JBPM_LIBRARY_VERSION
See Also:
Constant Field Values

processEngineWireContext

protected transient WireContext processEngineWireContext

transactionWireDefinition

protected transient WireDefinition transactionWireDefinition

userProvidedEnvironmentObjectsThreadLocal

protected transient java.lang.ThreadLocal<java.util.List<UserProvidedEnvironmentObject>> userProvidedEnvironmentObjectsThreadLocal

authenticatedUserIdThreadLocal

protected transient java.lang.ThreadLocal<java.lang.String> authenticatedUserIdThreadLocal

userCommandService

protected transient CommandService userCommandService
Constructor Detail

ProcessEngineImpl

public ProcessEngineImpl()

ProcessEngineImpl

public ProcessEngineImpl(ConfigurationImpl configuration)
Method Detail

initializeProcessEngine

protected void initializeProcessEngine(ConfigurationImpl configuration)

checkDb

protected void checkDb(ConfigurationImpl configuration)

getExecutionService

public ExecutionService getExecutionService()
Specified by:
getExecutionService in interface ProcessEngine

getHistoryService

public HistoryService getHistoryService()
Specified by:
getHistoryService in interface ProcessEngine

getManagementService

public ManagementService getManagementService()
Specified by:
getManagementService in interface ProcessEngine

getTaskService

public TaskService getTaskService()
Specified by:
getTaskService in interface ProcessEngine

getIdentityService

public IdentityService getIdentityService()
Specified by:
getIdentityService in interface ProcessEngine

getRepositoryService

public RepositoryService getRepositoryService()
Specified by:
getRepositoryService in interface ProcessEngine

openEnvironment

public EnvironmentImpl openEnvironment()
Description copied from interface: EnvironmentFactory
open a new EnvironmentImpl. The client is responsible for closing the environment with EnvironmentImpl.close().

Specified by:
openEnvironment in interface EnvironmentFactory

installAuthenticatedUserId

protected void installAuthenticatedUserId(EnvironmentImpl environment)

installTransactionContext

protected void installTransactionContext(PvmEnvironment environment)

installProcessEngineContext

protected void installProcessEngineContext(PvmEnvironment environment)

close

public void close()
Description copied from interface: EnvironmentFactory
closes this environment factory and cleans any allocated resources.

Specified by:
close in interface ProcessEngine
Specified by:
close in interface EnvironmentFactory

get

public java.lang.Object get(java.lang.String key)
Specified by:
get in interface ProcessEngine
Specified by:
get in interface Context

get

public <T> T get(java.lang.Class<T> type)
Specified by:
get in interface ProcessEngine
Specified by:
get in interface Context

getName

public java.lang.String getName()
Specified by:
getName in interface Context

has

public boolean has(java.lang.String key)
Specified by:
has in interface Context

keys

public java.util.Set<java.lang.String> keys()
Specified by:
keys in interface Context

set

public java.lang.Object set(java.lang.String key,
                            java.lang.Object value)
Specified by:
set in interface Context

addProcessEngineWireDefinition

public void addProcessEngineWireDefinition(WireDefinition wireDefinition)

addTransactionWireDefinition

public void addTransactionWireDefinition(WireDefinition wireDefinition)

setTransactionWireDefinition

public void setTransactionWireDefinition(WireDefinition transactionWireDefinition)

getProcessEngineWireContext

public WireContext getProcessEngineWireContext()

setProcessEngineWireContext

public void setProcessEngineWireContext(WireContext processEngineWireContext)

getTransactionWireDefinition

public WireDefinition getTransactionWireDefinition()

setAuthenticatedUserId

public ProcessEngine setAuthenticatedUserId(java.lang.String authenticatedUserId)
Specified by:
setAuthenticatedUserId in interface ProcessEngine

setHibernateSession

public ProcessEngine setHibernateSession(java.lang.Object hibernateSession)
Specified by:
setHibernateSession in interface ProcessEngine

setJdbcConnection

public ProcessEngine setJdbcConnection(java.sql.Connection jdbcConnection)
Specified by:
setJdbcConnection in interface ProcessEngine

addUserProvidedEnvironmentObject

protected void addUserProvidedEnvironmentObject(UserProvidedEnvironmentObject userProvidedEnvironmentObject)

execute

public <T> T execute(Command<T> command)
Specified by:
execute in interface ProcessEngine

parseXmlString

public static EnvironmentFactory parseXmlString(java.lang.String jbpmConfigurationXml)


Copyright © 2010 JBoss Community. All Rights Reserved.