Package com.aspectran.core.activity
Class AbstractActivity
- java.lang.Object
-
- com.aspectran.core.activity.AbstractActivity
-
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
AdviceActivity,DefaultActivity
public abstract class AbstractActivity extends java.lang.Object implements Activity
The Class AbstractActivity.Created: 2008. 03. 22 PM 5:48:09
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractActivity(ActivityContext context)Instantiates a new abstract activity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbackupCurrentActivity()Backups the current activity.voidclearRaisedException()booleancontainsBean(java.lang.Class<?> requiredType)Return whether a bean with the specified object type is present.booleancontainsBean(java.lang.String id)Return whether a bean with the specified id is present.ActivityContextgetActivityContext()Gets the activity context.ApplicationAdaptergetApplicationAdapter()Gets the application adapter.<T> TgetBean(java.lang.Class<T> requiredType)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.Class<T> requiredType, java.lang.String id)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.String id)Return an instance of the bean that matches the given id.<T> TgetBean(java.lang.String id, java.lang.Class<T> requiredType)Return an instance of the bean that matches the given id.<T> TgetBeanForConfig(java.lang.Class<T> requiredType)Return the bean instance that matches the specified object type.protected ActivitygetCurrentActivity()Gets the current activity.EnvironmentgetEnvironment()Returns the environment of the current activity context.java.lang.ThrowablegetRaisedException()Returns an instance of the currently raised exception.RequestAdaptergetRequestAdapter()Gets the request adapter.ResponseAdaptergetResponseAdapter()Gets the response adapter.java.lang.ThrowablegetRootCauseOfRaisedException()Returns the innermost one of the chained (wrapped) exceptions.SessionAdaptergetSessionAdapter()Gets the session adapter.booleanisExceptionRaised()Returns whether the exception was thrown.booleanisIncluded()Returns whether or not contained in other activity.protected voidremoveCurrentActivity()Removes the current activity.protected voidsaveCurrentActivity()Saves the current activity.protected voidsetIncluded(boolean included)Sets whether this activity is included in other activity.voidsetRaisedException(java.lang.Throwable raisedException)Sets an instance of the currently raised exception.protected voidsetRequestAdapter(RequestAdapter requestAdapter)Sets the request adapter.protected voidsetResponseAdapter(ResponseAdapter responseAdapter)Sets the response adapter.protected voidsetSessionAdapter(SessionAdapter sessionAdapter)Sets the session adapter.voidterminate()Throws an ActivityTerminatedException to terminate the current activity.voidterminate(java.lang.String cause)Throws an ActivityTerminatedException with the reason for terminating the current activity.-
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
executeAdvice, executeAdvice, finish, getAspectAdviceBean, getDeclaredResponse, getProcessResult, getProcessResult, getSetting, getTranslet, handleException, isResponseReserved, newActivity, perform, prepare, prepare, prepare, prepare, prepare, registerAspectRule, registerSettingsAdviceRule
-
-
-
-
Constructor Detail
-
AbstractActivity
protected AbstractActivity(ActivityContext context)
Instantiates a new abstract activity.- Parameters:
context- the activity context
-
-
Method Detail
-
getActivityContext
public ActivityContext getActivityContext()
Description copied from interface:ActivityGets the activity context.- Specified by:
getActivityContextin interfaceActivity- Returns:
- the activity context
-
getEnvironment
public Environment getEnvironment()
Description copied from interface:ActivityReturns the environment of the current activity context.- Specified by:
getEnvironmentin interfaceActivity- Returns:
- the environment
-
getCurrentActivity
protected Activity getCurrentActivity()
Gets the current activity.- Returns:
- the current activity
-
saveCurrentActivity
protected void saveCurrentActivity()
Saves the current activity.
-
backupCurrentActivity
protected void backupCurrentActivity()
Backups the current activity.
-
removeCurrentActivity
protected void removeCurrentActivity()
Removes the current activity.
-
isIncluded
public boolean isIncluded()
Description copied from interface:ActivityReturns whether or not contained in other activity.- Specified by:
isIncludedin interfaceActivity- Returns:
- true, if this activity is included in the other activity
-
setIncluded
protected void setIncluded(boolean included)
Sets whether this activity is included in other activity.- Parameters:
included- whether or not included in other activity
-
getApplicationAdapter
public ApplicationAdapter getApplicationAdapter()
Description copied from interface:ActivityGets the application adapter.- Specified by:
getApplicationAdapterin interfaceActivity- Returns:
- the application adapter
-
getSessionAdapter
public SessionAdapter getSessionAdapter()
Description copied from interface:ActivityGets the session adapter.- Specified by:
getSessionAdapterin interfaceActivity- Returns:
- the session adapter
-
setSessionAdapter
protected void setSessionAdapter(SessionAdapter sessionAdapter)
Sets the session adapter.- Parameters:
sessionAdapter- the new session adapter
-
getRequestAdapter
public RequestAdapter getRequestAdapter()
Description copied from interface:ActivityGets the request adapter.- Specified by:
getRequestAdapterin interfaceActivity- Returns:
- the request adapter
-
setRequestAdapter
protected void setRequestAdapter(RequestAdapter requestAdapter)
Sets the request adapter.- Parameters:
requestAdapter- the new request adapter
-
getResponseAdapter
public ResponseAdapter getResponseAdapter()
Description copied from interface:ActivityGets the response adapter.- Specified by:
getResponseAdapterin interfaceActivity- Returns:
- the response adapter
-
setResponseAdapter
protected void setResponseAdapter(ResponseAdapter responseAdapter)
Sets the response adapter.- Parameters:
responseAdapter- the new response adapter
-
isExceptionRaised
public boolean isExceptionRaised()
Description copied from interface:ActivityReturns whether the exception was thrown.- Specified by:
isExceptionRaisedin interfaceActivity- Returns:
- true, if is exception raised
-
getRaisedException
public java.lang.Throwable getRaisedException()
Description copied from interface:ActivityReturns an instance of the currently raised exception.- Specified by:
getRaisedExceptionin interfaceActivity- Returns:
- an instance of the currently raised exception
-
getRootCauseOfRaisedException
public java.lang.Throwable getRootCauseOfRaisedException()
Description copied from interface:ActivityReturns the innermost one of the chained (wrapped) exceptions.- Specified by:
getRootCauseOfRaisedExceptionin interfaceActivity- Returns:
- the innermost one of the chained (wrapped) exceptions
-
setRaisedException
public void setRaisedException(java.lang.Throwable raisedException)
Description copied from interface:ActivitySets an instance of the currently raised exception.- Specified by:
setRaisedExceptionin interfaceActivity- Parameters:
raisedException- an instance of the currently raised exception
-
clearRaisedException
public void clearRaisedException()
- Specified by:
clearRaisedExceptionin interfaceActivity
-
getBean
public <T> T getBean(java.lang.String id)
Description copied from interface:ActivityReturn an instance of the bean that matches the given id.
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType)
Description copied from interface:ActivityReturn an instance of the bean that matches the given object type.
-
getBean
public <T> T getBean(java.lang.String id, java.lang.Class<T> requiredType)Description copied from interface:ActivityReturn an instance of the bean that matches the given id. If the bean is not of the required type then throw a BeanNotOfRequiredTypeException.
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType, java.lang.String id)Description copied from interface:ActivityReturn an instance of the bean that matches the given object type. If the bean is not exists ,retrieve the bean with the specified id.
-
getBeanForConfig
public <T> T getBeanForConfig(java.lang.Class<T> requiredType)
Description copied from interface:ActivityReturn the bean instance that matches the specified object type. If the bean is not of the required type then throw aBeanNotOfRequiredTypeException.- Specified by:
getBeanForConfigin interfaceActivity- Type Parameters:
T- the generic type- Parameters:
requiredType- type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
-
containsBean
public boolean containsBean(java.lang.String id)
Description copied from interface:ActivityReturn whether a bean with the specified id is present.- Specified by:
containsBeanin interfaceActivity- Parameters:
id- the id of the bean to query- Returns:
- whether a bean with the specified id is present
-
containsBean
public boolean containsBean(java.lang.Class<?> requiredType)
Description copied from interface:ActivityReturn whether a bean with the specified object type is present.- Specified by:
containsBeanin interfaceActivity- Parameters:
requiredType- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
terminate
public void terminate()
Description copied from interface:ActivityThrows an ActivityTerminatedException to terminate the current activity.
-
-