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

      • perform

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

        public <V> V perform​(java.util.concurrent.Callable<V> instantAction)
        Description copied from interface: Activity
        Performs the given instant activity.
        Type Parameters:
        V - the result type of the instant action
        Parameters:
        instantAction - the instant action
        Returns:
        An object that is the result of performing an instant 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 <V> V getSetting​(java.lang.String settingName)
        Description copied from interface: Activity
        Gets the setting value in the translet scope.
        Type Parameters:
        V - the type of the value
        Parameters:
        settingName - the setting name
        Returns:
        the setting value
      • getAspectAdviceBean

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