public class CommandContext extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
attributes |
protected ClassLoader |
classLoader |
protected Clock |
clock |
protected List<CommandContextCloseListener> |
closeListeners |
protected Command<?> |
command |
protected CommandExecutor |
commandExecutor |
protected LinkedList<String> |
engineCfgStack |
protected Map<String,AbstractEngineConfiguration> |
engineConfigurations |
protected Throwable |
exception |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected LinkedList<Object> |
resultStack |
protected boolean |
reused |
protected Map<Class<?>,SessionFactory> |
sessionFactories |
protected Map<Class<?>,Session> |
sessions |
protected boolean |
useClassForNameClassLoading |
| Constructor and Description |
|---|
CommandContext(Command<?> command) |
protected Map<String,AbstractEngineConfiguration> engineConfigurations
protected LinkedList<String> engineCfgStack
protected Command<?> command
protected Map<Class<?>,SessionFactory> sessionFactories
protected Throwable exception
protected List<CommandContextCloseListener> closeListeners
protected boolean reused
protected LinkedList<Object> resultStack
protected CommandExecutor commandExecutor
protected ClassLoader classLoader
protected boolean useClassForNameClassLoading
protected Clock clock
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
public CommandContext(Command<?> command)
public void close()
protected void logException()
public void addCloseListener(CommandContextCloseListener commandContextCloseListener)
public List<CommandContextCloseListener> getCloseListeners()
protected void executeCloseListenersClosing()
protected void executeCloseListenersAfterSessionFlushed()
protected void executeCloseListenersClosed()
protected void executeCloseListenersCloseFailure()
protected void flushSessions()
protected void closeSessions()
public void exception(Throwable exception)
CommandContext instance. That exception will be rethrown at the end of closing the CommandContext instance.
If there is already an exception being stored, a 'masked exception' message will be logged.public void resetException()
public void removeAttribute(String key)
public <T> T getSession(Class<T> sessionClass)
public Map<Class<?>,SessionFactory> getSessionFactories()
public void setSessionFactories(Map<Class<?>,SessionFactory> sessionFactories)
public Map<String,AbstractEngineConfiguration> getEngineConfigurations()
public void setEngineConfigurations(Map<String,AbstractEngineConfiguration> engineConfigurations)
public void pushEngineCfgToStack(String engineCfgKey)
public String popEngineCfgStack()
public boolean isRootUsageOfCurrentEngine()
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.public void addEngineConfiguration(String engineKey, String scopeType, AbstractEngineConfiguration engineConfiguration)
public CommandExecutor getCommandExecutor()
public void setCommandExecutor(CommandExecutor commandExecutor)
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
public boolean isUseClassForNameClassLoading()
public void setUseClassForNameClassLoading(boolean useClassForNameClassLoading)
public Clock getClock()
public void setClock(Clock clock)
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public Command<?> getCommand()
public Throwable getException()
public boolean isReused()
public void setReused(boolean reused)
public Object getResult()
public void setResult(Object result)
Copyright © 2021 Flowable. All rights reserved.