Activity
, BeanRegistry
BasicActivity
public abstract class AbstractActivity extends java.lang.Object implements Activity
Created: 2008. 03. 22 PM 5:48:09
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractActivity(ActivityContext context) |
Instantiates a new abstract activity.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
backupCurrentActivity() |
Backups the current activity.
|
boolean |
containsBean(java.lang.Class<?> requiredType) |
Return whether a bean with the specified object type is present.
|
boolean |
containsBean(java.lang.String id) |
Return whether a bean with the specified id is present.
|
ActivityContext |
getActivityContext() |
Gets the activity context.
|
<T> T |
getAfterAdviceResult(java.lang.String aspectId) |
Gets the after advice result.
|
protected java.util.List<AspectAdviceRule> |
getAfterAdviceRuleList() |
|
ApplicationAdapter |
getApplicationAdapter() |
Gets the application adapter.
|
<T> T |
getAroundAdviceResult(java.lang.String aspectId) |
Gets the around advice result.
|
<T> T |
getAspectAdviceBean(java.lang.String aspectId) |
Gets the aspect advice bean.
|
protected AspectRuleRegistry |
getAspectRuleRegistry() |
Gets the aspect rule registry.
|
<T> T |
getBean(java.lang.Class<T> requiredType) |
Return an instance of the bean that matches the given object type.
|
<T> T |
getBean(java.lang.Class<T> requiredType,
java.lang.String id) |
Return an instance of the bean that matches the given object type.
|
<T> T |
getBean(java.lang.String id) |
Return an instance of the bean that matches the given id.
|
<T> T |
getBean(java.lang.String id,
java.lang.Class<T> requiredType) |
Return an instance of the bean that matches the given id.
|
BeanRegistry |
getBeanRegistry() |
Gets the bean registry.
|
<T> T |
getBeforeAdviceResult(java.lang.String aspectId) |
Gets the before advice result.
|
protected java.util.List<AspectAdviceRule> |
getBeforeAdviceRuleList() |
|
<T> T |
getConfigBean(java.lang.Class<T> classType) |
Return the bean instance that matches the specified object type.
|
protected Activity |
getCurrentActivity() |
Gets the current activity.
|
Environment |
getEnvironment() |
Returns the environment of the current activity context.
|
protected java.util.List<ExceptionRule> |
getExceptionRuleList() |
|
<T> T |
getFinallyAdviceResult(java.lang.String aspectId) |
Gets the finally advice result.
|
protected java.util.List<AspectAdviceRule> |
getFinallyAdviceRuleList() |
|
java.lang.Throwable |
getRaisedException() |
Returns an instance of the currently raised exception.
|
RequestAdapter |
getRequestAdapter() |
Gets the request adapter.
|
ResponseAdapter |
getResponseAdapter() |
Gets the response adapter.
|
java.lang.Throwable |
getRootCauseOfRaisedException() |
Returns the innermost one of the chained (wrapped) exceptions.
|
SessionAdapter |
getSessionAdapter() |
Gets the session adapter.
|
<T> T |
getSetting(java.lang.String settingName) |
Gets the setting value in the translet scope.
|
TemplateProcessor |
getTemplateProcessor() |
Gets the template processor.
|
protected TransletRuleRegistry |
getTransletRuleRegistry() |
Gets the translet rule registry.
|
boolean |
isExceptionRaised() |
Returns whether the exception was thrown.
|
boolean |
isIncluded() |
Returns whether or not contained in other activity.
|
protected void |
prepareAspectAdviceRule(TransletRule transletRule) |
|
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.
|
protected void |
removeCurrentActivity() |
Removes the current activity.
|
protected void |
saveCurrentActivity() |
Saves the current activity.
|
void |
setIncluded(boolean included) |
Sets whether this activity is included in other activity.
|
void |
setRaisedException(java.lang.Throwable raisedException) |
Sets an instance of the currently raised exception.
|
protected void |
setRequestAdapter(RequestAdapter requestAdapter) |
Sets the request adapter.
|
protected void |
setResponseAdapter(ResponseAdapter responseAdapter) |
Sets the response adapter.
|
protected void |
setSessionAdapter(SessionAdapter sessionAdapter) |
Sets the session adapter.
|
void |
terminate() |
Throws an ActivityTerminatedException to terminate the current activity.
|
void |
terminate(java.lang.String cause) |
Throws an ActivityTerminatedException with the reason for terminating the current activity.
|
protected AspectAdviceRuleRegistry |
touchAspectAdviceRuleRegistry() |
executeAdvice, executeAdvice, executeAdviceWithoutThrow, executeAdviceWithoutThrow, finish, getProcessResult, getProcessResult, getRequestMethod, getTranslet, getTransletName, handleException, isResponseReserved, newActivity, perform, performWithoutResponse, prepare, prepare, prepare, prepare
protected AbstractActivity(ActivityContext context)
context
- the activity contextpublic ActivityContext getActivityContext()
Activity
getActivityContext
in interface Activity
public Environment getEnvironment()
Activity
getEnvironment
in interface Activity
protected Activity getCurrentActivity()
protected void saveCurrentActivity()
protected void backupCurrentActivity()
protected void removeCurrentActivity()
public boolean isIncluded()
public void setIncluded(boolean included)
included
- whether or not included in other activitypublic java.lang.Throwable getRaisedException()
Activity
getRaisedException
in interface Activity
public void setRaisedException(java.lang.Throwable raisedException)
Activity
setRaisedException
in interface Activity
raisedException
- an instance of the currently raised exceptionpublic boolean isExceptionRaised()
Activity
isExceptionRaised
in interface Activity
public java.lang.Throwable getRootCauseOfRaisedException()
Activity
getRootCauseOfRaisedException
in interface Activity
public ApplicationAdapter getApplicationAdapter()
Activity
getApplicationAdapter
in interface Activity
public SessionAdapter getSessionAdapter()
Activity
getSessionAdapter
in interface Activity
protected void setSessionAdapter(SessionAdapter sessionAdapter)
sessionAdapter
- the new session adapterpublic RequestAdapter getRequestAdapter()
Activity
getRequestAdapter
in interface Activity
protected void setRequestAdapter(RequestAdapter requestAdapter)
requestAdapter
- the new request adapterpublic ResponseAdapter getResponseAdapter()
Activity
getResponseAdapter
in interface Activity
protected void setResponseAdapter(ResponseAdapter responseAdapter)
responseAdapter
- the new response adapterprotected AspectAdviceRuleRegistry touchAspectAdviceRuleRegistry()
protected java.util.List<AspectAdviceRule> getBeforeAdviceRuleList()
protected java.util.List<AspectAdviceRule> getAfterAdviceRuleList()
protected java.util.List<AspectAdviceRule> getFinallyAdviceRuleList()
protected java.util.List<ExceptionRule> getExceptionRuleList()
public <T> T getSetting(java.lang.String settingName)
Activity
getSetting
in interface Activity
T
- the type of the valuesettingName
- the setting namepublic <T> T getAspectAdviceBean(java.lang.String aspectId)
getAspectAdviceBean
in interface Activity
T
- the generic typeaspectId
- the aspect idprotected void putAspectAdviceBean(java.lang.String aspectId, java.lang.Object adviceBean)
aspectId
- the aspect idadviceBean
- the advice beanpublic <T> T getBeforeAdviceResult(java.lang.String aspectId)
T
- the generic typeaspectId
- the aspect idpublic <T> T getAfterAdviceResult(java.lang.String aspectId)
T
- the generic typeaspectId
- the aspect idpublic <T> T getAroundAdviceResult(java.lang.String aspectId)
T
- the generic typeaspectId
- the aspect idpublic <T> T getFinallyAdviceResult(java.lang.String aspectId)
T
- the generic typeaspectId
- the aspect idprotected void putAdviceResult(AspectAdviceRule aspectAdviceRule, java.lang.Object adviceActionResult)
aspectAdviceRule
- the aspect advice ruleadviceActionResult
- the advice action resultprotected AspectRuleRegistry getAspectRuleRegistry()
protected TransletRuleRegistry getTransletRuleRegistry()
public TemplateProcessor getTemplateProcessor()
Activity
getTemplateProcessor
in interface Activity
public BeanRegistry getBeanRegistry()
Activity
getBeanRegistry
in interface Activity
public <T> T getBean(java.lang.String id)
BeanRegistry
getBean
in interface BeanRegistry
T
- the generic typeid
- the id of the bean to retrievepublic <T> T getBean(java.lang.Class<T> requiredType)
BeanRegistry
getBean
in interface BeanRegistry
T
- the generic typerequiredType
- the type the bean must match; can be an interface or superclass. null
is disallowed.public <T> T getBean(java.lang.String id, java.lang.Class<T> requiredType)
BeanRegistry
getBean
in interface BeanRegistry
T
- the generic typeid
- the id of the bean to retrieverequiredType
- type the bean must match; can be an interface or superclass. null
is disallowed.public <T> T getBean(java.lang.Class<T> requiredType, java.lang.String id)
BeanRegistry
getBean
in interface BeanRegistry
T
- the generic typerequiredType
- type the bean must match; can be an interface or superclass. null
is allowed.id
- the id of the bean to retrieve; if requiredType is null
.public <T> T getConfigBean(java.lang.Class<T> classType)
BeanRegistry
BeanNotOfRequiredTypeException
.getConfigBean
in interface BeanRegistry
T
- the generic typeclassType
- type the bean must match; can be an interface or superclass. null
is disallowed.public boolean containsBean(java.lang.String id)
BeanRegistry
containsBean
in interface BeanRegistry
id
- the id of the bean to querypublic boolean containsBean(java.lang.Class<?> requiredType)
BeanRegistry
containsBean
in interface BeanRegistry
requiredType
- the object type of the bean to querypublic void terminate()
Activity
public void terminate(java.lang.String cause)
Activity
public void registerAspectRule(AspectRule aspectRule)
Activity
registerAspectRule
in interface Activity
aspectRule
- the aspect ruleprotected void prepareAspectAdviceRule(TransletRule transletRule)
Copyright © 2008–2018 The Aspectran Project. All rights reserved.