Class CommandContext
java.lang.Object
org.flowable.common.engine.impl.interceptor.CommandContext
- Author:
- Tom Baeyens, Agim Emruli, Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoaderprotected Clockprotected List<CommandContextCloseListener>protected Command<?>protected CommandExecutorprotected LinkedList<String>protected Map<String,AbstractEngineConfiguration> protected Throwableprotected com.fasterxml.jackson.databind.ObjectMapperprotected LinkedList<Object>protected booleanprotected Map<Class<?>,SessionFactory> protected final longThe start time when the command context was created.protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, Object value) voidaddCloseListener(CommandContextCloseListener commandContextCloseListener) voidaddEngineConfiguration(String engineKey, String scopeType, AbstractEngineConfiguration engineConfiguration) voidclose()protected voidvoidStores the provided exception on thisCommandContextinstance.protected voidprotected voidprotected voidprotected voidprotected voidgetAttribute(String key) getClock()Command<?>com.fasterxml.jackson.databind.ObjectMapper<T> TgetSession(Class<T> sessionClass) Map<Class<?>,SessionFactory> longbooleanisReused()booleanbooleanprotected voidvoidpushEngineCfgToStack(String engineCfgKey) voidremoveAttribute(String key) voidprotected voidvoidsetClassLoader(ClassLoader classLoader) voidvoidsetCommandExecutor(CommandExecutor commandExecutor) voidsetEngineConfigurations(Map<String, AbstractEngineConfiguration> engineConfigurations) voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) voidvoidsetReused(boolean reused) voidsetSessionFactories(Map<Class<?>, SessionFactory> sessionFactories) voidsetUseClassForNameClassLoading(boolean useClassForNameClassLoading)
-
Field Details
-
engineConfigurations
-
engineCfgStack
-
command
-
sessionFactories
-
sessions
-
exception
-
closeListeners
-
attributes
-
reused
protected boolean reused -
resultStack
-
commandExecutor
-
classLoader
-
useClassForNameClassLoading
protected boolean useClassForNameClassLoading -
clock
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
startTime
protected final long startTimeThe start time when the command context was created. This is the result ofSystem.currentTimeMillis()when the command context was created.
-
-
Constructor Details
-
CommandContext
-
-
Method Details
-
close
public void close() -
logException
protected void logException() -
rethrowExceptionIfNeeded
- Throws:
Error
-
addCloseListener
-
getCloseListeners
-
executeCloseListenersClosing
protected void executeCloseListenersClosing() -
executeCloseListenersAfterSessionFlushed
protected void executeCloseListenersAfterSessionFlushed() -
executeCloseListenersClosed
protected void executeCloseListenersClosed() -
executeCloseListenersCloseFailure
protected void executeCloseListenersCloseFailure() -
flushSessions
protected void flushSessions() -
closeSessions
protected void closeSessions() -
exception
Stores the provided exception on thisCommandContextinstance. That exception will be rethrown at the end of closing theCommandContextinstance. If there is already an exception being stored, a 'masked exception' message will be logged. -
resetException
public void resetException() -
addAttribute
-
getAttribute
-
removeAttribute
-
getSession
-
getSessionFactories
-
setSessionFactories
-
getEngineConfigurations
-
setEngineConfigurations
-
pushEngineCfgToStack
-
popEngineCfgStack
-
isRootUsageOfCurrentEngine
public boolean isRootUsageOfCurrentEngine()- Returns:
- Returns whether (at the time of calling this method) the current engine
is being executed as the 'root engine'. Or said differently: this will return
false when the current engine is being used in a nested
Commandexecution call and will return true if it is the root usage of the current engine. For example: CMMN engine executes process task, that in its turn calls a CMMN task. The hierarchy of engine will be CMMN (a) - BPMN (b) - CMMN (c). If this method is called in the context of (c), false is returned. In the context of (a), true will be returned. For (b), there is but one usage and it will be true.
-
addEngineConfiguration
public void addEngineConfiguration(String engineKey, String scopeType, AbstractEngineConfiguration engineConfiguration) -
getCommandExecutor
-
setCommandExecutor
-
getClassLoader
-
setClassLoader
-
isUseClassForNameClassLoading
public boolean isUseClassForNameClassLoading() -
setUseClassForNameClassLoading
public void setUseClassForNameClassLoading(boolean useClassForNameClassLoading) -
getClock
-
setClock
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
getCommand
-
getSessions
-
getException
-
isReused
public boolean isReused() -
setReused
public void setReused(boolean reused) -
getResult
-
setResult
-
getStartTime
public long getStartTime()
-