Class CommandContext


  • public class CommandContext
    extends Object
    Author:
    Tom Baeyens, Agim Emruli, Joram Barrez
    • Constructor Detail

      • CommandContext

        public CommandContext​(Command<?> command)
    • Method Detail

      • close

        public void close()
      • logException

        protected void logException()
      • rethrowExceptionIfNeeded

        protected void rethrowExceptionIfNeeded()
                                         throws Error
        Throws:
        Error
      • 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 this 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.
      • resetException

        public void resetException()
      • addAttribute

        public void addAttribute​(String key,
                                 Object value)
      • removeAttribute

        public void removeAttribute​(String key)
      • getSession

        public <T> T getSession​(Class<T> sessionClass)
      • 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 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.
      • setCommandExecutor

        public void setCommandExecutor​(CommandExecutor commandExecutor)
      • 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)