Class CommandContext
java.lang.Object
org.flowable.common.engine.impl.interceptor.CommandContext
- Author:
- Tom Baeyens, Agim Emruli, Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoader
protected Clock
protected List<CommandContextCloseListener>
protected Command<?>
protected CommandExecutor
protected LinkedList<String>
protected Map<String,
AbstractEngineConfiguration> protected Throwable
protected com.fasterxml.jackson.databind.ObjectMapper
protected LinkedList<Object>
protected boolean
protected Map<Class<?>,
SessionFactory> protected final long
The start time when the command context was created.protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String key, Object value) void
addCloseListener
(CommandContextCloseListener commandContextCloseListener) void
addEngineConfiguration
(String engineKey, String scopeType, AbstractEngineConfiguration engineConfiguration) void
close()
protected void
void
Stores the provided exception on thisCommandContext
instance.protected void
protected void
protected void
protected void
protected void
getAttribute
(String key) getClock()
Command<?>
com.fasterxml.jackson.databind.ObjectMapper
<T> T
getSession
(Class<T> sessionClass) Map<Class<?>,
SessionFactory> long
boolean
isReused()
boolean
boolean
protected void
void
pushEngineCfgToStack
(String engineCfgKey) void
removeAttribute
(String key) void
protected void
void
setClassLoader
(ClassLoader classLoader) void
void
setCommandExecutor
(CommandExecutor commandExecutor) void
setEngineConfigurations
(Map<String, AbstractEngineConfiguration> engineConfigurations) void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) void
void
setReused
(boolean reused) void
setSessionFactories
(Map<Class<?>, SessionFactory> sessionFactories) void
setUseClassForNameClassLoading
(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 thisCommandContext
instance. That exception will be rethrown at the end of closing theCommandContext
instance. 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
Command
execution 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()
-