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 void
executeAdvice(Executable action)
Executes advice action.void
executeAdvice(AspectAdviceRule aspectAdviceRule, boolean throwable)
Executes an aspect advice with a given rule.void
executeAdvice(java.util.List<AspectAdviceRule> aspectAdviceRuleList, boolean throwable)
Execute aspect advices with given rules.<T> T
getAfterAdviceResult(java.lang.String aspectId)
Gets the after advice result.protected java.util.List<AspectAdviceRule>
getAfterAdviceRuleList()
<T> T
getAroundAdviceResult(java.lang.String aspectId)
Gets the around advice result.<T> T
getAspectAdviceBean(java.lang.String aspectId)
Gets the aspect advice bean.<T> T
getBeforeAdviceResult(java.lang.String aspectId)
Gets the before advice result.protected java.util.List<AspectAdviceRule>
getBeforeAdviceRuleList()
protected java.util.List<ExceptionRule>
getExceptionRuleList()
<T> T
getFinallyAdviceResult(java.lang.String aspectId)
Gets the finally advice result.protected java.util.List<AspectAdviceRule>
getFinallyAdviceRuleList()
<T> T
getSetting(java.lang.String settingName)
Gets the setting value in the translet scope.protected ExceptionThrownRule
handleException(ExceptionRule exceptionRule)
void
handleException(java.util.List<ExceptionRule> exceptionRuleList)
Exception handling.protected void
prepareAspectAdviceRule(TransletRule transletRule, boolean merge)
protected void
putAdviceResult(AspectAdviceRule aspectAdviceRule, java.lang.Object adviceActionResult)
Puts the result of the advice.protected void
putAspectAdviceBean(java.lang.String aspectId, java.lang.Object adviceBean)
Puts the aspect advice bean.void
registerAspectRule(AspectRule aspectRule)
Register an aspect rule dynamically.void
registerSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)
Register a settings advice rule dynamically.protected void
setCurrentAspectAdviceType(AspectAdviceType aspectAdviceType)
protected AspectAdviceRuleRegistry
touchAspectAdviceRuleRegistry()
-
Methods inherited from class com.aspectran.core.activity.AbstractActivity
backupCurrentActivity, clearRaisedException, containsBean, containsBean, getActivityContext, getApplicationAdapter, getBean, getBean, getBean, getBean, getBeanForConfig, getCurrentActivity, getEnvironment, getOuterActivity, getPrototypeScopeBean, 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: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
-
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:Activity
Execute 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:Activity
Executes 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:Activity
Exception handling.- Parameters:
exceptionRuleList
- the exception rule list
-
handleException
protected ExceptionThrownRule 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: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 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
-
-