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
,ShellActivity
,TowActivity
,WebActivity
public class CoreActivity extends AdviceActivity
Core activity that handles all external requests.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
Constructors Modifier Constructor Description protected
CoreActivity(ActivityContext context)
Instantiates a new CoreActivity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adapt()
protected void
execute(ActionList actionList)
protected void
execute(ActionList actionList, ContentResult contentResult)
Response
getDeclaredResponse()
Returns the originally declared response.protected Response
getDesiredResponse()
protected java.lang.String
getIntendedRequestEncoding()
Determines the default request encoding.protected java.lang.String
getIntendedResponseEncoding()
Determines the default response encoding.ProcessResult
getProcessResult()
Returns the process result.java.lang.Object
getProcessResult(java.lang.String actionId)
Returns an action result for the specified action id from the process result, ornull
if the action does not exist.protected RequestRule
getRequestRule()
Returns the request rule.protected ResponseRule
getResponseRule()
Returns the response rule.Translet
getTranslet()
Returns an instance of the current translet.protected TransletRule
getTransletRule()
Returns the translet rule.ExceptionThrownRule
handleException(ExceptionRule exceptionRule)
boolean
isResponseReserved()
Returns whether the response is reserved.protected void
parseDeclaredAttributes()
Parses the declared attributes.protected void
parseDeclaredParameters()
Parses the declared parameters.protected void
parseRequest()
void
perform()
Performs the prepared activity.<V> V
perform(java.util.concurrent.Callable<V> instantAction)
Performs the given instant activity.void
prepare(TransletRule transletRule)
Prepare for the activity.void
prepare(java.lang.String requestName)
Prepare for the activity.void
prepare(java.lang.String requestName, TransletRule transletRule)
Prepare for the activity.void
prepare(java.lang.String requestName, MethodType requestMethod)
Prepare for the activity.void
prepare(java.lang.String requestName, java.lang.String requestMethod)
Prepare for the activity.protected void
release()
protected void
reserveResponse()
protected void
reserveResponse(Response response)
protected LocaleResolver
resolveLocale()
-
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, registerAspectAdviceRule, registerSettingsAdviceRule, setCurrentAspectAdviceType
-
Methods inherited from class com.aspectran.core.activity.AbstractActivity
clearRaisedException, containsBean, containsBean, containsBean, getActivityContext, getApplicationAdapter, getBean, getBean, getBean, getCurrentActivity, getEnvironment, getParentActivity, getPrototypeScopeBean, getRaisedException, getRequestAdapter, getResponseAdapter, getRootCauseOfRaisedException, getSessionAdapter, hasParentActivity, isExceptionRaised, removeCurrentActivity, saveCurrentActivity, setRaisedException, setRequestAdapter, setResponseAdapter, setSessionAdapter, terminate, terminate
-
-
-
-
Constructor Detail
-
CoreActivity
protected CoreActivity(ActivityContext context)
Instantiates a new CoreActivity.- Parameters:
context
- the activity context
-
-
Method Detail
-
prepare
public void prepare(java.lang.String requestName) throws TransletNotFoundException, ActivityPrepareException
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
public void prepare(TransletRule transletRule) throws ActivityPrepareException
Prepare for the activity.- Parameters:
transletRule
- the translet rule- Throws:
ActivityPrepareException
- thrown when an exception occurs while preparing an activity
-
prepare
public void prepare(java.lang.String requestName, TransletRule transletRule) throws ActivityPrepareException
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(java.lang.String requestName, java.lang.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(java.lang.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
-
adapt
protected void adapt() throws AdapterException
- Throws:
AdapterException
-
parseRequest
protected void parseRequest() throws ActivityTerminatedException, RequestParseException
-
resolveLocale
protected LocaleResolver resolveLocale()
-
perform
public void perform() throws ActivityPerformException
Description copied from interface:Activity
Performs the prepared activity.- Throws:
ActivityPerformException
- thrown when an exception occurs while performing an activity
-
perform
public <V> V perform(java.util.concurrent.Callable<V> instantAction) throws ActivityPerformException
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
-
release
protected void release()
-
execute
protected void execute(ActionList actionList) throws ActionExecutionException
- Throws:
ActionExecutionException
-
execute
protected void execute(ActionList actionList, ContentResult contentResult) throws ActionExecutionException
- Throws:
ActionExecutionException
-
handleException
public ExceptionThrownRule handleException(ExceptionRule exceptionRule) throws ActionExecutionException
- Overrides:
handleException
in classAdviceActivity
- Throws:
ActionExecutionException
-
reserveResponse
protected void reserveResponse(Response response)
-
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
protected Response getDesiredResponse()
-
getTranslet
public Translet getTranslet()
Description copied from interface:Activity
Returns an instance of the current translet.- Returns:
- an instance of the current translet
-
getProcessResult
public ProcessResult getProcessResult()
Description copied from interface:Activity
Returns the process result.- Returns:
- the process result
-
getProcessResult
public java.lang.Object getProcessResult(java.lang.String actionId)
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
protected TransletRule getTransletRule()
Returns the translet rule.- Returns:
- the translet rule
-
getRequestRule
protected RequestRule getRequestRule()
Returns the request rule.- Returns:
- the request rule
-
getResponseRule
protected ResponseRule getResponseRule()
Returns the response rule.- Returns:
- the response rule
-
getDeclaredResponse
public Response getDeclaredResponse()
Description copied from interface:Activity
Returns the originally declared response.- Returns:
- the declared response
-
getIntendedRequestEncoding
protected java.lang.String getIntendedRequestEncoding()
Determines the default request encoding.- Returns:
- the default request encoding
-
getIntendedResponseEncoding
protected java.lang.String getIntendedResponseEncoding()
Determines the default response encoding.- Returns:
- the default response encoding
-
parseDeclaredParameters
protected void parseDeclaredParameters() throws MissingMandatoryParametersException
Parses the declared parameters.
-
parseDeclaredAttributes
protected void parseDeclaredAttributes() throws MissingMandatoryAttributesException
Parses the declared attributes.- Throws:
MissingMandatoryAttributesException
- thrown if a required attribute is missing from the request
-
-