Class CommandContext


  • public class CommandContext
    extends java.lang.Object
    • Field Detail

      • command

        protected Command<?> command
      • sessionFactories

        protected java.util.Map<java.lang.Class<?>,​SessionFactory> sessionFactories
      • sessions

        protected java.util.Map<java.lang.Class<?>,​Session> sessions
      • exception

        protected java.lang.Throwable exception
      • attributes

        protected java.util.Map<java.lang.String,​java.lang.Object> attributes
      • reused

        protected boolean reused
      • involvedExecutions

        protected java.util.Map<java.lang.String,​ExecutionEntity> involvedExecutions
      • resultStack

        protected java.util.LinkedList<java.lang.Object> resultStack
    • Method Detail

      • close

        public void close()
      • logException

        protected void logException()
      • rethrowExceptionIfNeeded

        protected void rethrowExceptionIfNeeded()
                                         throws java.lang.Error
        Throws:
        java.lang.Error
      • hasCloseListener

        public boolean hasCloseListener​(java.lang.Class<?> type)
      • 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​(java.lang.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.

      • addAttribute

        public void addAttribute​(java.lang.String key,
                                 java.lang.Object value)
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
      • getGenericAttribute

        public <T> T getGenericAttribute​(java.lang.String key)
      • getSession

        public <T> T getSession​(java.lang.Class<T> sessionClass)
      • getSessionFactories

        public java.util.Map<java.lang.Class<?>,​SessionFactory> getSessionFactories()
      • getJobManager

        public JobManager getJobManager()
      • addInvolvedExecution

        public void addInvolvedExecution​(ExecutionEntity executionEntity)
      • hasInvolvedExecutions

        public boolean hasInvolvedExecutions()
      • getInvolvedExecutions

        public java.util.Collection<ExecutionEntity> getInvolvedExecutions()
      • getCommand

        public Command<?> getCommand()
      • getSessions

        public java.util.Map<java.lang.Class<?>,​Session> getSessions()
      • getException

        public java.lang.Throwable getException()
      • getResult

        public java.lang.Object getResult()
      • setResult

        public void setResult​(java.lang.Object result)
      • isReused

        public boolean isReused()
      • setReused

        public void setReused​(boolean reused)