Package com.aspectran.core.activity
Class CoreActivity
java.lang.Object
com.aspectran.core.activity.AbstractActivity
com.aspectran.core.activity.AdviceActivity
com.aspectran.core.activity.CoreActivity
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
AspectranActivity
,DaemonActivity
,InstantActivity
,JobActivity
,NonActivity
,ShellActivity
,TowActivity
,WebActivity
Core activity for handling official requests in Aspectran services.
This class is generally not thread-safe. It is primarily designed for use in a single thread only.
Created: 2008. 03. 22 PM 5:48:09
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CoreActivity
(ActivityContext context) Instantiates a new CoreActivity.protected
CoreActivity
(ActivityContext context, String contextPath) Instantiates a new CoreActivity. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
adapt()
protected void
execute
(ActionList actionList) protected void
execute
(ActionList actionList, ContentResult contentResult) Returns the context path.Returns the originally declared response.protected Response
protected String
Determines the default request encoding.protected String
Determines the default response encoding.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.protected RequestRule
protected ResponseRule
Returns an instance of the current translet.protected TransletRule
protected ExceptionThrownRule
handleException
(ExceptionRule exceptionRule) protected boolean
boolean
Returns whether a response was attempted after performing the activity.protected boolean
boolean
Returns whether the request name has a context path.boolean
Returns whether the response is reserved.protected void
Parses the declared attributes.protected void
Parses the declared parameters.protected void
void
perform()
Performs the prepared activity.<V> V
perform
(InstantAction<V> instantAction) Performs the given instant activity.void
prepare
(TransletRule transletRule) Prepare for the activity.void
Prepare for the activity.void
prepare
(String requestName, TransletRule transletRule) Prepare for the activity.void
prepare
(String requestName, MethodType requestMethod) Prepare for the activity.void
prepare
(String requestName, MethodType requestMethod, TransletRule transletRule) Prepares a new activity for the Translet Rule by taking the results of the process that was created earlier.void
Prepare for the activity.protected void
protected void
reserveResponse
(Response response) protected LocaleResolver
Methods inherited from class com.aspectran.core.activity.AdviceActivity
executeAdvice, executeAdvice, getAfterAdviceResult, getAfterAdviceRuleList, getAroundAdviceResult, getAspectAdviceBean, getBeforeAdviceResult, getBeforeAdviceRuleList, getExceptionRuleList, getFinallyAdviceResult, getFinallyAdviceRuleList, getSetting, handleException, prepareAspectAdviceRule, putAdviceResult, putAspectAdviceBean, putSetting, registerAspectAdviceRule, registerSettingsAdviceRule, setCurrentAspectAdviceType
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
-
CoreActivity
Instantiates a new CoreActivity.- Parameters:
context
- the activity context
-
CoreActivity
Instantiates a new CoreActivity.- 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.
-
prepare
Prepare for the activity.- Parameters:
requestName
- the request name- Throws:
TransletNotFoundException
- thrown if the translet is not foundActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
Prepare for the activity.- Parameters:
transletRule
- the translet rule- Throws:
ActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
Prepare for the activity.- Parameters:
requestName
- the request nametransletRule
- the translet rule- Throws:
ActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
public void prepare(String requestName, String requestMethod) throws TransletNotFoundException, ActivityPrepareException Prepare for the activity.- Parameters:
requestName
- the request namerequestMethod
- the request method- Throws:
TransletNotFoundException
- thrown if the translet is not foundActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
public void prepare(String requestName, MethodType requestMethod) throws TransletNotFoundException, ActivityPrepareException Prepare for the activity.- Parameters:
requestName
- the request namerequestMethod
- the request method- Throws:
TransletNotFoundException
- thrown if the translet is not foundActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
public void prepare(String requestName, MethodType requestMethod, TransletRule transletRule) throws ActivityPrepareException Prepares a new activity for the Translet Rule by taking the results of the process that was created earlier.- Parameters:
requestName
- the request namerequestMethod
- the request methodtransletRule
- the translet rule- Throws:
ActivityPrepareException
-
isAdapted
protected boolean isAdapted() -
adapt
- Throws:
AdapterException
-
isRequestParsed
protected boolean isRequestParsed() -
parseRequest
-
resolveLocale
-
perform
Description copied from interface:Activity
Performs the prepared activity.- Throws:
ActivityPerformException
- thrown when an exception occurs while performing an 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
- Throws:
ActivityPerformException
- thrown when an exception occurs while performing an activity
-
execute
- Throws:
ActionExecutionException
-
execute
protected void execute(ActionList actionList, ContentResult contentResult) throws ActionExecutionException - Throws:
ActionExecutionException
-
handleException
protected ExceptionThrownRule handleException(ExceptionRule exceptionRule) throws ActionExecutionException - Overrides:
handleException
in classAdviceActivity
- Throws:
ActionExecutionException
-
reserveResponse
-
reserveResponse
protected void reserveResponse() -
isResponseReserved
public boolean isResponseReserved()Description copied from interface:Activity
Returns whether the response is reserved.- Returns:
- true, if the response is reserved
-
getDesiredResponse
-
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
-
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
-
getTransletRule
-
getRequestRule
-
getResponseRule
-
getDeclaredResponse
Description copied from interface:Activity
Returns the originally declared response.- Returns:
- the declared response
-
getIntendedRequestEncoding
Determines the default request encoding.- Returns:
- the default request encoding
-
getIntendedResponseEncoding
Determines the default response encoding.- Returns:
- the default response encoding
-
parseDeclaredParameters
Parses the declared parameters. -
parseDeclaredAttributes
Parses the declared attributes.- Throws:
MissingMandatoryAttributesException
- thrown if a required attribute is missing from the request
-