Class AbstractActivity

  • All Implemented Interfaces:
    Activity
    Direct Known Subclasses:
    AdviceActivity, DefaultActivity

    public abstract class AbstractActivity
    extends java.lang.Object
    implements Activity
    The Class AbstractActivity.

    Created: 2008. 03. 22 PM 5:48:09

    • Constructor Detail

      • AbstractActivity

        protected AbstractActivity​(ActivityContext context)
        Instantiates a new abstract activity.
        Parameters:
        context - the activity context
    • Method Detail

      • getEnvironment

        public Environment getEnvironment()
        Description copied from interface: Activity
        Returns the environment of the current activity context.
        Specified by:
        getEnvironment in interface Activity
        Returns:
        the environment
      • getCurrentActivity

        protected Activity getCurrentActivity()
        Gets the current activity.
        Returns:
        the current activity
      • saveCurrentActivity

        protected void saveCurrentActivity()
        Saves the current activity.
      • backupCurrentActivity

        protected void backupCurrentActivity()
        Backups the current activity.
      • removeCurrentActivity

        protected void removeCurrentActivity()
        Removes the current activity.
      • isIncluded

        public boolean isIncluded()
        Description copied from interface: Activity
        Returns whether or not contained in other activity.
        Specified by:
        isIncluded in interface Activity
        Returns:
        true, if this activity is included in the other activity
      • setIncluded

        protected void setIncluded​(boolean included)
        Sets whether this activity is included in other activity.
        Parameters:
        included - whether or not included in other activity
      • setSessionAdapter

        protected void setSessionAdapter​(SessionAdapter sessionAdapter)
        Sets the session adapter.
        Parameters:
        sessionAdapter - the new session adapter
      • setRequestAdapter

        protected void setRequestAdapter​(RequestAdapter requestAdapter)
        Sets the request adapter.
        Parameters:
        requestAdapter - the new request adapter
      • setResponseAdapter

        protected void setResponseAdapter​(ResponseAdapter responseAdapter)
        Sets the response adapter.
        Parameters:
        responseAdapter - the new response adapter
      • isExceptionRaised

        public boolean isExceptionRaised()
        Description copied from interface: Activity
        Returns whether the exception was thrown.
        Specified by:
        isExceptionRaised in interface Activity
        Returns:
        true, if is exception raised
      • getRaisedException

        public java.lang.Throwable getRaisedException()
        Description copied from interface: Activity
        Returns an instance of the currently raised exception.
        Specified by:
        getRaisedException in interface Activity
        Returns:
        an instance of the currently raised exception
      • getRootCauseOfRaisedException

        public java.lang.Throwable getRootCauseOfRaisedException()
        Description copied from interface: Activity
        Returns the innermost one of the chained (wrapped) exceptions.
        Specified by:
        getRootCauseOfRaisedException in interface Activity
        Returns:
        the innermost one of the chained (wrapped) exceptions
      • setRaisedException

        public void setRaisedException​(java.lang.Throwable raisedException)
        Description copied from interface: Activity
        Sets an instance of the currently raised exception.
        Specified by:
        setRaisedException in interface Activity
        Parameters:
        raisedException - an instance of the currently raised exception
      • clearRaisedException

        public void clearRaisedException()
        Description copied from interface: Activity
        Clears the exception that occurred during activity processing.
        Specified by:
        clearRaisedException in interface Activity
      • getBean

        public <T> T getBean​(java.lang.String id)
        Description copied from interface: Activity
        Return an instance of the bean that matches the given id.
        Specified by:
        getBean in interface Activity
        Type Parameters:
        T - the generic type
        Parameters:
        id - the id of the bean to retrieve
        Returns:
        an instance of the bean
      • getBean

        public <T> T getBean​(java.lang.Class<T> type)
        Description copied from interface: Activity
        Return an instance of the bean that matches the given object type.
        Specified by:
        getBean in interface Activity
        Type Parameters:
        T - the generic type
        Parameters:
        type - the type the bean must match; can be an interface or superclass. null is disallowed.
        Returns:
        an instance of the bean
      • getBean

        public <T> T getBean​(java.lang.Class<T> type,
                             java.lang.String id)
        Description copied from interface: Activity
        Return an instance of the bean that matches the given object type.
        Specified by:
        getBean in interface Activity
        Type Parameters:
        T - the generic type
        Parameters:
        type - type the bean must match; can be an interface or superclass. null is allowed.
        id - the id of the bean to retrieve
        Returns:
        an instance of the bean
      • containsBean

        public boolean containsBean​(java.lang.String id)
        Description copied from interface: Activity
        Return whether a bean with the specified id is present.
        Specified by:
        containsBean in interface Activity
        Parameters:
        id - the id of the bean to query
        Returns:
        whether a bean with the specified id is present
      • containsBean

        public boolean containsBean​(java.lang.Class<?> type)
        Description copied from interface: Activity
        Return whether a bean with the specified object type is present.
        Specified by:
        containsBean in interface Activity
        Parameters:
        type - the object type of the bean to query
        Returns:
        whether a bean with the specified type is present
      • containsBean

        public boolean containsBean​(java.lang.Class<?> type,
                                    java.lang.String id)
        Specified by:
        containsBean in interface Activity
      • terminate

        public void terminate()
        Description copied from interface: Activity
        Throws an ActivityTerminatedException to terminate the current activity.
        Specified by:
        terminate in interface Activity
      • terminate

        public void terminate​(java.lang.String cause)
        Description copied from interface: Activity
        Throws an ActivityTerminatedException with the reason for terminating the current activity.
        Specified by:
        terminate in interface Activity
        Parameters:
        cause - the termination cause