Package com.aspectran.core.activity
Class DefaultActivity
- java.lang.Object
-
- com.aspectran.core.activity.AbstractActivity
-
- com.aspectran.core.activity.DefaultActivity
-
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
InstantActivity,SessionScopeActivity
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 Summary
Constructors Constructor Description DefaultActivity(ActivityContext context)Instantiates a new DefaultActivity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidfinish()Finish the current activity.<T> TgetAspectAdviceBean(java.lang.String aspectId)Gets the aspect advice bean.ResponsegetDeclaredResponse()Returns the originally declared response.ProcessResultgetProcessResult()Returns the process result.java.lang.ObjectgetProcessResult(java.lang.String actionId)Returns an action result for the specified action id from the process result, ornullif the action does not exist.<T> TgetSetting(java.lang.String settingName)Gets the setting value in the translet scope.TransletgetTranslet()Returns an instance of the current translet.voidhandleException(java.util.List<ExceptionRule> exceptionRuleList)Exception handling.booleanisResponseReserved()Returns whether the response is reserved.<T extends Activity>
TnewActivity()Create a new inner activity.voidperform()Performs the prepared activity.voidprepare(TransletRule transletRule)Prepare for the activity.voidprepare(java.lang.String transletName)Prepare for the activity.voidprepare(java.lang.String transletName, TransletRule transletRule)Prepare for the activity.voidprepare(java.lang.String transletName, MethodType requestMethod)Prepare for the activity.voidprepare(java.lang.String transletName, java.lang.String requestMethod)Prepare for the activity.voidregisterAspectRule(AspectRule aspectRule)Register an aspect rule dynamically.voidregisterSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)-
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
-
-
-
-
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:ActivityPrepare for the activity.- Parameters:
transletName- the translet name
-
prepare
public void prepare(TransletRule transletRule)
Description copied from interface:ActivityPrepare for the activity.- Parameters:
transletRule- the translet rule
-
prepare
public void prepare(java.lang.String transletName, TransletRule transletRule)Description copied from interface:ActivityPrepare for the activity.- Parameters:
transletName- the translet nametransletRule- the translet rule
-
prepare
public void prepare(java.lang.String transletName, java.lang.String requestMethod)Description copied from interface:ActivityPrepare for the activity.- Parameters:
transletName- the translet namerequestMethod- the request method
-
prepare
public void prepare(java.lang.String transletName, MethodType requestMethod)Description copied from interface:ActivityPrepare for the activity.- Parameters:
transletName- the translet namerequestMethod- the request method
-
perform
public void perform()
Description copied from interface:ActivityPerforms the prepared activity.
-
finish
public void finish()
Description copied from interface:ActivityFinish the current activity. It must be called to finish the activity.
-
getTranslet
public Translet getTranslet()
Description copied from interface:ActivityReturns an instance of the current translet.- Returns:
- an instance of the current translet
-
getProcessResult
public ProcessResult getProcessResult()
Description copied from interface:ActivityReturns the process result.- Returns:
- the process result
-
getProcessResult
public java.lang.Object getProcessResult(java.lang.String actionId)
Description copied from interface:ActivityReturns an action result for the specified action id from the process result, ornullif the action does not exist.- Parameters:
actionId- the specified action id- Returns:
- an action result
-
getDeclaredResponse
public Response getDeclaredResponse()
Description copied from interface:ActivityReturns the originally declared response.- Returns:
- the declared response
-
isResponseReserved
public boolean isResponseReserved()
Description copied from interface:ActivityReturns 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: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
-
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)
-
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)
Description copied from interface:ActivityGets the aspect advice bean.- Type Parameters:
T- the type of the bean- Parameters:
aspectId- the aspect id- Returns:
- the aspect advice bean object
-
-