Class CommandContext
- java.lang.Object
-
- org.flowable.common.engine.impl.interceptor.CommandContext
-
public class CommandContext extends Object
- Author:
- Tom Baeyens, Agim Emruli, Joram Barrez
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>attributesprotected ClassLoaderclassLoaderprotected Clockclockprotected List<CommandContextCloseListener>closeListenersprotected Command<?>commandprotected CommandExecutorcommandExecutorprotected LinkedList<String>engineCfgStackprotected Map<String,AbstractEngineConfiguration>engineConfigurationsprotected Throwableexceptionprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected LinkedList<Object>resultStackprotected booleanreusedprotected Map<Class<?>,SessionFactory>sessionFactoriesprotected Map<Class<?>,Session>sessionsprotected booleanuseClassForNameClassLoading
-
Constructor Summary
Constructors Constructor Description CommandContext(Command<?> command)
-
Method Summary
-
-
-
Field Detail
-
engineConfigurations
protected Map<String,AbstractEngineConfiguration> engineConfigurations
-
engineCfgStack
protected LinkedList<String> engineCfgStack
-
command
protected Command<?> command
-
sessionFactories
protected Map<Class<?>,SessionFactory> sessionFactories
-
exception
protected Throwable exception
-
closeListeners
protected List<CommandContextCloseListener> closeListeners
-
reused
protected boolean reused
-
resultStack
protected LinkedList<Object> resultStack
-
commandExecutor
protected CommandExecutor commandExecutor
-
classLoader
protected ClassLoader classLoader
-
useClassForNameClassLoading
protected boolean useClassForNameClassLoading
-
clock
protected Clock clock
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Detail
-
CommandContext
public CommandContext(Command<?> command)
-
-
Method Detail
-
close
public void close()
-
logException
protected void logException()
-
addCloseListener
public void addCloseListener(CommandContextCloseListener commandContextCloseListener)
-
getCloseListeners
public List<CommandContextCloseListener> 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
public void exception(Throwable 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()
-
removeAttribute
public void removeAttribute(String key)
-
getSession
public <T> T getSession(Class<T> sessionClass)
-
getSessionFactories
public Map<Class<?>,SessionFactory> getSessionFactories()
-
setSessionFactories
public void setSessionFactories(Map<Class<?>,SessionFactory> sessionFactories)
-
getEngineConfigurations
public Map<String,AbstractEngineConfiguration> getEngineConfigurations()
-
setEngineConfigurations
public void setEngineConfigurations(Map<String,AbstractEngineConfiguration> engineConfigurations)
-
pushEngineCfgToStack
public void pushEngineCfgToStack(String engineCfgKey)
-
popEngineCfgStack
public String 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
public CommandExecutor getCommandExecutor()
-
setCommandExecutor
public void setCommandExecutor(CommandExecutor commandExecutor)
-
getClassLoader
public ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
-
isUseClassForNameClassLoading
public boolean isUseClassForNameClassLoading()
-
setUseClassForNameClassLoading
public void setUseClassForNameClassLoading(boolean useClassForNameClassLoading)
-
getClock
public Clock getClock()
-
setClock
public void setClock(Clock clock)
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
getCommand
public Command<?> getCommand()
-
getException
public Throwable getException()
-
isReused
public boolean isReused()
-
setReused
public void setReused(boolean reused)
-
getResult
public Object getResult()
-
setResult
public void setResult(Object result)
-
-