Package com.aspectran.core.activity
Class AdviceActivity
- java.lang.Object
-
- com.aspectran.core.activity.AbstractActivity
-
- com.aspectran.core.activity.AdviceActivity
-
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
CoreActivity
public abstract class AdviceActivity extends AbstractActivity
Activity related to advice.Created: 2016. 9. 10.
-
-
Constructor Summary
Constructors Constructor Description AdviceActivity(ActivityContext context)Instantiates a new AdviceActivity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecuteAdvice(Executable action)Executes advice action.voidexecuteAdvice(AspectAdviceRule aspectAdviceRule, boolean throwable)Executes an aspect advice with a given rule.voidexecuteAdvice(java.util.List<AspectAdviceRule> aspectAdviceRuleList, boolean throwable)Execute aspect advices with given rules.<T> TgetAfterAdviceResult(java.lang.String aspectId)Gets the after advice result.protected java.util.List<AspectAdviceRule>getAfterAdviceRuleList()<T> TgetAroundAdviceResult(java.lang.String aspectId)Gets the around advice result.<T> TgetAspectAdviceBean(java.lang.String aspectId)Gets the aspect advice bean.<T> TgetBeforeAdviceResult(java.lang.String aspectId)Gets the before advice result.protected java.util.List<AspectAdviceRule>getBeforeAdviceRuleList()protected java.util.List<ExceptionRule>getExceptionRuleList()<T> TgetFinallyAdviceResult(java.lang.String aspectId)Gets the finally advice result.protected java.util.List<AspectAdviceRule>getFinallyAdviceRuleList()<T> TgetSetting(java.lang.String settingName)Gets the setting value in the translet scope.protected voidhandleException(ExceptionRule exceptionRule)voidhandleException(java.util.List<ExceptionRule> exceptionRuleList)Exception handling.protected voidprepareAspectAdviceRule(TransletRule transletRule, boolean merge)protected voidputAdviceResult(AspectAdviceRule aspectAdviceRule, java.lang.Object adviceActionResult)Puts the result of the advice.protected voidputAspectAdviceBean(java.lang.String aspectId, java.lang.Object adviceBean)Puts the aspect advice bean.voidregisterAspectRule(AspectRule aspectRule)Register an aspect rule dynamically.voidregisterSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)protected voidsetCurrentAspectAdviceType(AspectAdviceType aspectAdviceType)protected AspectAdviceRuleRegistrytouchAspectAdviceRuleRegistry()-
Methods inherited from class com.aspectran.core.activity.AbstractActivity
backupCurrentActivity, clearRaisedException, containsBean, containsBean, getActivityContext, getApplicationAdapter, getBean, getBean, getBean, getBean, getBeanForConfig, getCurrentActivity, getEnvironment, getRaisedException, getRequestAdapter, getResponseAdapter, getRootCauseOfRaisedException, getSessionAdapter, isExceptionRaised, isIncluded, removeCurrentActivity, saveCurrentActivity, setIncluded, setRaisedException, setRequestAdapter, setResponseAdapter, setSessionAdapter, terminate, terminate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.aspectran.core.activity.Activity
finish, getDeclaredResponse, getProcessResult, getProcessResult, getTranslet, isResponseReserved, newActivity, perform, prepare, prepare, prepare, prepare, prepare
-
-
-
-
Constructor Detail
-
AdviceActivity
public AdviceActivity(ActivityContext context)
Instantiates a new AdviceActivity.- Parameters:
context- the activity context
-
-
Method Detail
-
prepareAspectAdviceRule
protected void prepareAspectAdviceRule(TransletRule transletRule, boolean merge)
-
registerAspectRule
public void registerAspectRule(AspectRule aspectRule)
Description copied from interface:ActivityRegister an aspect rule dynamically.- Parameters:
aspectRule- the aspect rule
-
registerSettingsAdviceRule
public void registerSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)
-
setCurrentAspectAdviceType
protected void setCurrentAspectAdviceType(AspectAdviceType aspectAdviceType)
-
executeAdvice
protected void executeAdvice(Executable action)
Executes advice action.- Parameters:
action- the executable action
-
executeAdvice
public void executeAdvice(java.util.List<AspectAdviceRule> aspectAdviceRuleList, boolean throwable)
Description copied from interface:ActivityExecute aspect advices with given rules.- Parameters:
aspectAdviceRuleList- the aspect advice rulesthrowable- whether to raise an exception
-
executeAdvice
public void executeAdvice(AspectAdviceRule aspectAdviceRule, boolean throwable)
Description copied from interface:ActivityExecutes an aspect advice with a given rule.- Parameters:
aspectAdviceRule- the aspect advice rulethrowable- whether to raise an exception
-
handleException
public void handleException(java.util.List<ExceptionRule> exceptionRuleList)
Description copied from interface:ActivityException handling.- Parameters:
exceptionRuleList- the exception rule list
-
handleException
protected void handleException(ExceptionRule exceptionRule)
-
touchAspectAdviceRuleRegistry
protected AspectAdviceRuleRegistry touchAspectAdviceRuleRegistry()
-
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:ActivityGets 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 idadviceBean- 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 ruleadviceActionResult- the advice action result
-
-