com.sun.grizzly.arp
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 defined Adapter or GrizzlyAdapter
 boolean finishExecute()
          finish the processing on this connection until new data come.
 AsyncHandler getAsyncHandler()
          Get the AsyncHandler who drive the asynchronous process.
 AsyncTask getAsyncTask()
          Get the AsyncProcesssorTask.
 ProcessorTask getProcessorTask()
          The ProcessorTask used to execute the request processing.
 boolean interrupt()
          Interrupt the current request processing.
 boolean postExecute()
          Commit the http response.
 boolean preExecute()
          Pre-execute some http request operation like decoding the headers.
 boolean removeAsyncFilter(AsyncFilter asyncFilter)
          Remove an AsyncFilter
 void reset()
          Reset
 void setAsyncHandler(AsyncHandler asyncHandler)
          Set the AsyncHandler who drive the asynchronous process.
 void setAsyncTask(AsyncTask task)
          Set the AsyncProcesssorTask.
 void setProcessorTask(ProcessorTask task)
          Set the ProcessorTask used to execute the request processing.
 

Method Detail

preExecute

boolean preExecute()
                   throws Exception
Pre-execute some http request operation like decoding the headers.

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

interrupt

boolean interrupt()
                  throws Exception
Interrupt the current request processing. To resume, just invoke the execute()

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

execute

boolean execute()
                throws Exception
Execute the defined Adapter or GrizzlyAdapter

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

postExecute

boolean postExecute()
                    throws Exception
Commit the http response.

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

finishExecute

boolean finishExecute()
                      throws Exception
finish the processing on this connection until new data come.

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

setAsyncTask

void setAsyncTask(AsyncTask task)
Set the AsyncProcesssorTask.


getAsyncTask

AsyncTask getAsyncTask()
Get the AsyncProcesssorTask.


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.


setProcessorTask

void setProcessorTask(ProcessorTask task)
Set the ProcessorTask used to execute the request processing.

Parameters:
task - a ProcessorTask

getProcessorTask

ProcessorTask getProcessorTask()
The ProcessorTask used to execute the request processing.

Returns:
ProcessorTask used to execute the request processing.

reset

void reset()
Reset



Copyright © 2012 Oracle Corporation. All Rights Reserved.