Class AdviceActivity

  • All Implemented Interfaces:
    Activity
    Direct Known Subclasses:
    CoreActivity

    public abstract class AdviceActivity
    extends AbstractActivity
    Activity related to advice.

    Created: 2016. 9. 10.

    • Constructor Detail

      • AdviceActivity

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

      • prepareAspectAdviceRule

        protected void prepareAspectAdviceRule​(@NonNull
                                               TransletRule transletRule)
      • registerSettingsAdviceRule

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

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

        protected void setCurrentAspectAdviceType​(AspectAdviceType aspectAdviceType)
      • 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
      • getBeforeAdviceRuleList

        protected java.util.List<AspectAdviceRule> getBeforeAdviceRuleList()
      • getAfterAdviceRuleList

        protected java.util.List<AspectAdviceRule> getAfterAdviceRuleList()
      • getFinallyAdviceRuleList

        protected java.util.List<AspectAdviceRule> getFinallyAdviceRuleList()
      • getExceptionRuleList

        protected java.util.List<ExceptionRule> getExceptionRuleList()
      • 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)
        Gets the aspect advice bean.
        Type Parameters:
        T - the generic type
        Parameters:
        aspectId - the aspect id
        Returns:
        the aspect advice bean
      • putAspectAdviceBean

        protected void putAspectAdviceBean​(java.lang.String aspectId,
                                           java.lang.Object adviceBean)
        Puts the aspect advice bean.
        Parameters:
        aspectId - the aspect id
        adviceBean - the advice bean
      • getBeforeAdviceResult

        public <T> T getBeforeAdviceResult​(java.lang.String aspectId)
        Gets the before advice result.
        Type Parameters:
        T - the generic type
        Parameters:
        aspectId - the aspect id
        Returns:
        the before advice result
      • getAfterAdviceResult

        public <T> T getAfterAdviceResult​(java.lang.String aspectId)
        Gets the after advice result.
        Type Parameters:
        T - the generic type
        Parameters:
        aspectId - the aspect id
        Returns:
        the after advice result
      • getAroundAdviceResult

        public <T> T getAroundAdviceResult​(java.lang.String aspectId)
        Gets the around advice result.
        Type Parameters:
        T - the generic type
        Parameters:
        aspectId - the aspect id
        Returns:
        the around advice result
      • getFinallyAdviceResult

        public <T> T getFinallyAdviceResult​(java.lang.String aspectId)
        Gets the finally advice result.
        Type Parameters:
        T - the generic type
        Parameters:
        aspectId - the aspect id
        Returns:
        the finally advice result
      • putAdviceResult

        protected void putAdviceResult​(AspectAdviceRule aspectAdviceRule,
                                       java.lang.Object adviceActionResult)
        Puts the result of the advice.
        Parameters:
        aspectAdviceRule - the aspect advice rule
        adviceActionResult - the advice action result