Class DefaultActivity

  • All Implemented Interfaces:
    Activity

    public class DefaultActivity
    extends AbstractActivity
    Default activity to handle all internal requests.

    Note that this is an activity that has nothing to do with advice. This does not execute any advice at all, and if you attempt to register the advice dynamically, you will get an exception of the advice constraint violation.

    • Constructor Detail

      • DefaultActivity

        public DefaultActivity​(ActivityContext context)
        Instantiates a new DefaultActivity.
        Parameters:
        context - the activity context
    • Method Detail

      • prepare

        public void prepare​(java.lang.String transletName)
        Description copied from interface: Activity
        Prepare for the activity.
        Parameters:
        transletName - the translet name
      • prepare

        public void prepare​(TransletRule transletRule)
        Description copied from interface: Activity
        Prepare for the activity.
        Parameters:
        transletRule - the translet rule
      • prepare

        public void prepare​(java.lang.String transletName,
                            TransletRule transletRule)
        Description copied from interface: Activity
        Prepare for the activity.
        Parameters:
        transletName - the translet name
        transletRule - the translet rule
      • prepare

        public void prepare​(java.lang.String transletName,
                            java.lang.String requestMethod)
        Description copied from interface: Activity
        Prepare for the activity.
        Parameters:
        transletName - the translet name
        requestMethod - the request method
      • prepare

        public void prepare​(java.lang.String transletName,
                            MethodType requestMethod)
        Description copied from interface: Activity
        Prepare for the activity.
        Parameters:
        transletName - the translet name
        requestMethod - the request method
      • perform

        public void perform()
        Description copied from interface: Activity
        Performs the prepared activity.
      • perform

        public java.lang.Object perform​(InstantAction instantAction)
      • close

        public void close()
        Description copied from interface: Activity
        Finish the current activity. It must be called to finish the activity.
      • getTranslet

        public Translet getTranslet()
        Description copied from interface: Activity
        Returns an instance of the current translet.
        Returns:
        an instance of the current translet
      • getProcessResult

        public ProcessResult getProcessResult()
        Description copied from interface: Activity
        Returns the process result.
        Returns:
        the process result
      • getProcessResult

        public java.lang.Object getProcessResult​(java.lang.String actionId)
        Description copied from interface: Activity
        Returns an action result for the specified action id from the process result, or null if the action does not exist.
        Parameters:
        actionId - the specified action id
        Returns:
        an action result
      • getDeclaredResponse

        public Response getDeclaredResponse()
        Description copied from interface: Activity
        Returns the originally declared response.
        Returns:
        the declared response
      • isResponseReserved

        public boolean isResponseReserved()
        Description copied from interface: Activity
        Returns whether the response is reserved.
        Returns:
        true, if the response is reserved
      • executeAdvice

        public void executeAdvice​(java.util.List<AspectAdviceRule> aspectAdviceRuleList,
                                  boolean throwable)
        Description copied from interface: Activity
        Execute aspect advices with given rules.
        Parameters:
        aspectAdviceRuleList - the aspect advice rules
        throwable - whether to raise an exception
      • executeAdvice

        public void executeAdvice​(AspectAdviceRule aspectAdviceRule,
                                  boolean throwable)
        Description copied from interface: Activity
        Executes an aspect advice with a given rule.
        Parameters:
        aspectAdviceRule - the aspect advice rule
        throwable - whether to raise an exception
      • handleException

        public void handleException​(java.util.List<ExceptionRule> exceptionRuleList)
        Description copied from interface: Activity
        Exception handling.
        Parameters:
        exceptionRuleList - the exception rule list
      • registerAspectAdviceRule

        public void registerAspectAdviceRule​(AspectRule aspectRule)
        Description copied from interface: Activity
        Register an aspect rule dynamically.
        Parameters:
        aspectRule - the aspect rule
      • registerSettingsAdviceRule

        public void registerSettingsAdviceRule​(SettingsAdviceRule settingsAdviceRule)
        Description copied from interface: Activity
        Register a settings advice rule dynamically.
        Parameters:
        settingsAdviceRule - the settings advice rule
      • getSetting

        public <T> T getSetting​(java.lang.String settingName)
        Description copied from interface: Activity
        Gets the setting value in the translet scope.
        Type Parameters:
        T - the type of the value
        Parameters:
        settingName - the setting name
        Returns:
        the setting value
      • getAspectAdviceBean

        public <T> T getAspectAdviceBean​(java.lang.String aspectId)
        Description copied from interface: Activity
        Gets the aspect advice bean.
        Type Parameters:
        T - the type of the bean
        Parameters:
        aspectId - the aspect id
        Returns:
        the aspect advice bean object
      • newActivity

        public <T extends Activity> T newActivity()
        Description copied from interface: Activity
        Create a new inner activity.
        Type Parameters:
        T - the type of the activity
        Returns:
        the activity object