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 voidclearRaisedException()Clears the exception that occurred during activity processing.booleancontainsBean(java.lang.Class<?> type)Returns whether a bean with the specified object type is present.booleancontainsBean(java.lang.Class<?> type, java.lang.String id)Returns whether the bean corresponding to the specified object type and ID exists.booleancontainsBean(java.lang.String id)Returns whether a bean with the specified id is present.ActivityContextgetActivityContext()Gets the activity context.ApplicationAdaptergetApplicationAdapter()Gets the application adapter.<V> VgetBean(java.lang.Class<V> type)Returns an instance of the bean that matches the given object type.<V> VgetBean(java.lang.Class<V> type, java.lang.String id)Returns an instance of the bean that matches the given object type.<V> VgetBean(java.lang.String id)Returns an instance of the bean that matches the given id.protected ActivitygetCurrentActivity()Gets the current activity.EnvironmentgetEnvironment()Returns the environment of the current activity context.protected <V extends Activity>
VgetParentActivity()<V> VgetPrototypeScopeBean(BeanRule beanRule)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.protected booleanhasParentActivity()booleanisExceptionRaised()Returns whether the exception was thrown.protected voidremoveCurrentActivity()Removes the current activity.protected voidsaveCurrentActivity()Saves the current 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, getAspectAdviceBean, getDeclaredResponse, getProcessResult, getProcessResult, getSetting, getTranslet, handleException, isResponseReserved, perform, perform, registerAspectAdviceRule, 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.
-
removeCurrentActivity
protected void removeCurrentActivity()
Removes the current activity.
-
getParentActivity
protected <V extends Activity> V getParentActivity()
-
hasParentActivity
protected boolean hasParentActivity()
-
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()
Description copied from interface:ActivityClears the exception that occurred during activity processing.- Specified by:
clearRaisedExceptionin interfaceActivity
-
getBean
public <V> V getBean(java.lang.String id)
Description copied from interface:ActivityReturns an instance of the bean that matches the given id.
-
getBean
public <V> V getBean(java.lang.Class<V> type)
Description copied from interface:ActivityReturns an instance of the bean that matches the given object type.
-
getBean
public <V> V getBean(java.lang.Class<V> type, java.lang.String id)Description copied from interface:ActivityReturns an instance of the bean that matches the given object type.
-
getPrototypeScopeBean
public <V> V getPrototypeScopeBean(BeanRule beanRule)
- Specified by:
getPrototypeScopeBeanin interfaceActivity
-
containsBean
public boolean containsBean(java.lang.String id)
Description copied from interface:ActivityReturns 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<?> type)
Description copied from interface:ActivityReturns whether a bean with the specified object type is present.- Specified by:
containsBeanin interfaceActivity- Parameters:
type- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
containsBean
public boolean containsBean(java.lang.Class<?> type, java.lang.String id)Description copied from interface:ActivityReturns whether the bean corresponding to the specified object type and ID exists.- Specified by:
containsBeanin interfaceActivity- Parameters:
type- the object type of the bean to queryid- the id of the bean to query- Returns:
- whether a bean with the specified type is present
-
terminate
public void terminate() throws ActivityTerminatedExceptionDescription copied from interface:ActivityThrows an ActivityTerminatedException to terminate the current activity.- Specified by:
terminatein interfaceActivity- Throws:
ActivityTerminatedException- if an activity terminated without completion
-
terminate
public void terminate(java.lang.String cause) throws ActivityTerminatedExceptionDescription copied from interface:ActivityThrows an ActivityTerminatedException with the reason for terminating the current activity.- Specified by:
terminatein interfaceActivity- Parameters:
cause- the termination cause- Throws:
ActivityTerminatedException- the exception to terminate activity
-
-