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
Modifier and TypeFieldDescriptionprotected boolean
protected Exception
protected ActionInvocation
protected String
-
Constructor Summary
ConstructorDescriptionStrutsBackgroundProcess
(ActionInvocation invocation, String threadName, int threadPriority) Constructs a background process -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called after the background thread determines the result code from the ActionInvocation, but before the background thread is marked as done.protected void
Called 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.boolean
isDone()
Returns the status of the background process.prepare()
void
run()
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:
prepare
in 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:
getAction
in interfaceBackgroundProcess
- Returns:
- the action.
-
getInvocation
Retrieves the action invocation.- Specified by:
getInvocation
in interfaceBackgroundProcess
- Returns:
- the action invocation
-
getResult
Gets the result of the background process.- Specified by:
getResult
in 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:
getException
in interfaceBackgroundProcess
- Returns:
- the exception or null if no exception was thrown.
-
isDone
public boolean isDone()Returns the status of the background process.- Specified by:
isDone
in interfaceBackgroundProcess
- Returns:
- true if finished, false otherwise
-
toString
-