Package com.aspectran.core.activity
Class DefaultActivity
java.lang.Object
com.aspectran.core.activity.AbstractActivity
com.aspectran.core.activity.DefaultActivity
- All Implemented Interfaces:
Activity
Default activity used only internally when there is no official activity.
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
ConstructorsConstructorDescriptionDefaultActivity
(ActivityContext context) Instantiates a new DefaultActivity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeAdvice
(AspectAdviceRule aspectAdviceRule, boolean throwable) Executes an aspect advice with a given rule.void
executeAdvice
(List<AspectAdviceRule> aspectAdviceRuleList, boolean throwable) Execute aspect advices with given rules.<V> V
getAspectAdviceBean
(String aspectId) Gets the aspect advice bean.Returns the context path.Returns the originally declared response.Returns the process result.getProcessResult
(String actionId) Returns an action result for the specified action id from the process result, ornull
if the action does not exist.<V> V
getSetting
(String name) Gets the specified setting value from the current activity scope.Returns an instance of the current translet.void
handleException
(List<ExceptionRule> exceptionRuleList) Exception handling.boolean
Returns whether a response was attempted after performing the activity.boolean
Returns whether the request name has a context path.boolean
Returns whether the response is reserved.void
perform()
Performs the prepared activity.<V> V
perform
(InstantAction<V> instantAction) Performs the given instant activity.void
putSetting
(String name, Object value) Puts the specified setting value in the current activity scope.void
registerAspectAdviceRule
(AspectRule aspectRule) Register an aspect rule dynamically.void
registerSettingsAdviceRule
(SettingsAdviceRule settingsAdviceRule) Register a settings advice rule dynamically.Methods inherited from class com.aspectran.core.activity.AbstractActivity
clearRaisedException, containsBean, containsBean, containsBean, getActivityContext, getApplicationAdapter, getBean, getBean, getBean, getClassLoader, getCurrentActivity, getEnvironment, getParentActivity, getPrototypeScopeBean, getRaisedException, getRequestAdapter, getResponseAdapter, getRootCauseOfRaisedException, getSessionAdapter, hasParentActivity, isExceptionRaised, removeCurrentActivity, saveCurrentActivity, setRaisedException, setRequestAdapter, setResponseAdapter, setSessionAdapter, terminate, terminate
-
Constructor Details
-
DefaultActivity
Instantiates a new DefaultActivity.- Parameters:
context
- the activity context
-
-
Method Details
-
getContextPath
Description copied from interface:Activity
Returns the context path. If the context path is not specified,null
is returned rather than an empty string.- Returns:
- the context path
-
isRequestWithContextPath
public boolean isRequestWithContextPath()Description copied from interface:Activity
Returns whether the request name has a context path.- Returns:
- true if request name with context path, false otherwise.
-
perform
public void perform()Description copied from interface:Activity
Performs the prepared activity. -
perform
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
Description copied from interface:Activity
Returns an instance of the current translet.- Returns:
- an instance of the current translet
-
getProcessResult
Description copied from interface:Activity
Returns the process result.- Returns:
- the process result
-
getProcessResult
Description copied from interface:Activity
Returns an action result for the specified action id from the process result, ornull
if the action does not exist.- Parameters:
actionId
- the specified action id- Returns:
- an action result
-
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
-
isCommitted
public boolean isCommitted()Description copied from interface:Activity
Returns whether a response was attempted after performing the activity.- Returns:
- true if a response was attempted, false otherwise
-
registerAspectAdviceRule
Description copied from interface:Activity
Register an aspect rule dynamically.- Parameters:
aspectRule
- the aspect rule
-
registerSettingsAdviceRule
Description copied from interface:Activity
Register a settings advice rule dynamically.- Parameters:
settingsAdviceRule
- the settings advice rule
-
executeAdvice
Description copied from interface:Activity
Execute aspect advices with given rules.- Parameters:
aspectAdviceRuleList
- the aspect advice rulesthrowable
- whether to raise an exception
-
executeAdvice
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
Description copied from interface:Activity
Exception handling.- Parameters:
exceptionRuleList
- the exception rule list
-
getSetting
Description copied from interface:Activity
Gets the specified setting value from the current activity scope.- Type Parameters:
V
- the type of the value- Parameters:
name
- the setting name- Returns:
- the setting value
-
putSetting
Description copied from interface:Activity
Puts the specified setting value in the current activity scope.- Parameters:
name
- the setting namevalue
- the setting value
-
getAspectAdviceBean
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
-