Class StrutsBackgroundProcess
java.lang.Object
org.apache.struts2.interceptor.exec.StrutsBackgroundProcess
- All Implemented Interfaces:
Serializable,Runnable,BackgroundProcess
Background thread to be executed by the ExecuteAndWaitInterceptor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Exceptionprotected ActionInvocationprotected String -
Constructor Summary
ConstructorsConstructorDescriptionStrutsBackgroundProcess(ActionInvocation invocation, String threadName, int threadPriority) Constructs a background process -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled after the background thread determines the result code from the ActionInvocation, but before the background thread is marked as done.protected voidCalled before the background thread determines the result code from the ActionInvocation.Retrieves the action.Gets the exception if any was thrown during the execution of the background process.Retrieves the action invocation.Gets the result of the background process.booleanisDone()Returns the status of the background process.prepare()voidrun()toString()
-
Field Details
-
invocation
-
exception
-
result
-
done
protected boolean done
-
-
Constructor Details
-
StrutsBackgroundProcess
Constructs a background process- Parameters:
invocation- The action invocationthreadName- The name of background threadthreadPriority- The priority of background thread
-
-
Method Details
-
prepare
- Specified by:
preparein interfaceBackgroundProcess
-
run
public void run() -
beforeInvocation
Called before the background thread determines the result code from the ActionInvocation.- Throws:
Exception- any exception thrown will be thrown, in turn, by the ExecuteAndWaitInterceptor
-
afterInvocation
Called after the background thread determines the result code from the ActionInvocation, but before the background thread is marked as done.- Throws:
Exception- any exception thrown will be thrown, in turn, by the ExecuteAndWaitInterceptor
-
getAction
Retrieves the action.- Specified by:
getActionin interfaceBackgroundProcess- Returns:
- the action.
-
getInvocation
Retrieves the action invocation.- Specified by:
getInvocationin interfaceBackgroundProcess- Returns:
- the action invocation
-
getResult
Gets the result of the background process.- Specified by:
getResultin interfaceBackgroundProcess- Returns:
- the result; null if not done.
-
getException
Gets the exception if any was thrown during the execution of the background process.- Specified by:
getExceptionin interfaceBackgroundProcess- Returns:
- the exception or null if no exception was thrown.
-
isDone
public boolean isDone()Returns the status of the background process.- Specified by:
isDonein interfaceBackgroundProcess- Returns:
- true if finished, false otherwise
-
toString
-