com.sun.grizzly.http
Interface AsyncExecutor

All Known Implementing Classes:
DefaultAsyncExecutor

public interface AsyncExecutor

A interface used to define the execution of a AsyncTask By default, AsyncTask will invoke an implementation of this interface in this order: (1) preExecute() (2) interrupt() (3) postExecute() Implementation of this interface must decide when a task must be interrupted.

Author:
Jeanfrancois Arcand

Method Summary
 void addAsyncFilter(AsyncFilter asyncFilter)
          Add a AsyncFilter
 boolean execute()
          Execute the main operation on
 AsyncHandler getAsyncHandler()
          Get the AsyncHandler who drive the asynchronous process.
 AsyncTask getAsyncTask()
          Get the AsycnProcesssorTask.
 boolean interrupt()
          Execute some operations on the AsycnProcesssorTask and then interrupt it.
 boolean postExecute()
          Post-execute some operations in the AsycnProcesssorTask associated.
 boolean preExecute()
          Pre-execute some operations in the AsycnProcesssorTask associated.
 boolean removeAsyncFilter(AsyncFilter asyncFilter)
          Remove an AsyncFilter
 void setAsyncHandler(AsyncHandler asyncHandler)
          Set the AsyncHandler who drive the asynchronous process.
 void setAsyncTask(AsyncTask task)
          Set the AsycnProcesssorTask.
 

Method Detail

preExecute

boolean preExecute()
                   throws Exception
Pre-execute some operations in the AsycnProcesssorTask associated.

Returns:
true if the processing can continue.
Throws:
Exception

interrupt

boolean interrupt()
                  throws Exception
Execute some operations on the AsycnProcesssorTask and then interrupt it.

Returns:
true if the processing can continue, false if it needs to be interrupted.
Throws:
Exception

execute

boolean execute()
                throws Exception
Execute the main operation on

Returns:
true if the processing can continue, false if it needs to be interrupted.
Throws:
Exception

postExecute

boolean postExecute()
                    throws Exception
Post-execute some operations in the AsycnProcesssorTask associated.

Returns:
true if the processing can continue.
Throws:
Exception

setAsyncTask

void setAsyncTask(AsyncTask task)
Set the AsycnProcesssorTask.


getAsyncTask

AsyncTask getAsyncTask()
Get the AsycnProcesssorTask.


addAsyncFilter

void addAsyncFilter(AsyncFilter asyncFilter)
Add a AsyncFilter


removeAsyncFilter

boolean removeAsyncFilter(AsyncFilter asyncFilter)
Remove an AsyncFilter


getAsyncHandler

AsyncHandler getAsyncHandler()
Get the AsyncHandler who drive the asynchronous process.


setAsyncHandler

void setAsyncHandler(AsyncHandler asyncHandler)
Set the AsyncHandler who drive the asynchronous process.



Copyright © 2011 SUN Microsystems. All Rights Reserved.