Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.interceptor
Class BackgroundProcess

    java.lang.Object
      org.apache.struts2.interceptor.BackgroundProcess

All Implemented Interfaces:
  Serializable

    public class BackgroundProcess

extends Object
implements Serializable

Background thread to be executed by the ExecuteAndWaitInterceptor.

See Also:
  Serialized Form

Field Summary
`protected Object` | `action`
`protected boolean` | `done`
`protected Exception` | `exception`
`protected ActionInvocation` | `invocation`
`protected String` | `result`

Constructor Summary
`BackgroundProcess(String threadName, ActionInvocation invocation, int threadPriority)` Constructs a background process

Method Summary
`protected void` | `afterInvocation()` Called after the background thread determines the result code from the ActionInvocation, but before the background thread is marked as done.
`protected void` | `beforeInvocation()` Called before the background thread determines the result code from the ActionInvocation.
`Object` | `getAction()` Retrieves the action.
`Exception` | `getException()` Gets the exception if any was thrown during the execution of the background process.
`ActionInvocation` | `getInvocation()` Retrieves the action invocation.
`String` | `getResult()` Gets the result of the background process.
`boolean` | `isDone()` Returns the status of the background process.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### action

    protected Object action

### invocation

    protected ActionInvocation invocation

### result

    protected String result

### exception

    protected Exception exception

### done

    protected boolean done

Constructor Detail

### BackgroundProcess

    public BackgroundProcess(String threadName,
                             ActionInvocation invocation,
                             int threadPriority)

  Constructs a background process

  Parameters:
    `threadName` - The thread name
    `invocation` - The action invocation
    `threadPriority` - The thread priority

Method Detail

### beforeInvocation

    protected void beforeInvocation()
                             throws Exception

  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

    protected void afterInvocation()
                            throws Exception

  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

    public Object getAction()

  Retrieves the action.

  Returns:
    the action.

### getInvocation

    public ActionInvocation getInvocation()

  Retrieves the action invocation.

  Returns:
    the action invocation

### getResult

    public String getResult()

  Gets the result of the background process.

  Returns:
    the result; `null` if not done.

### getException

    public Exception getException()

  Gets the exception if any was thrown during the execution of the background process.

  Returns:
    the exception or `null` if no exception was thrown.

### isDone

    public boolean isDone()

  Returns the status of the background process.

  Returns:
    `true` if finished, `false` otherwise

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2017 Apache Software Foundation. All rights reserved.