org.glassfish.grizzly.web
Interface Task

All Superinterfaces:
Callable, Runnable
All Known Subinterfaces:
AsyncTask
All Known Implementing Classes:
AsyncProcessorTask, ProcessorTask, TaskBase

public interface Task
extends Runnable, Callable

Wrapper object used by the WorkerThread

Author:
Jean-Francois Arcand

Method Summary
 void doTask()
          Execute the task.
 void execute()
          Execute this task by using the associated ExecutorService.
 Connection getConnection()
           
 ExecutorService getThreadPool()
          Return the thread pool used by this object.
 void recycle()
          Recycle this task.
 void setConnection(Connection connection)
           
 void setThreadPool(ExecutorService threadPool)
          Set the thread pool on which Worker Threads will synchronize.
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Method Detail

doTask

void doTask()
            throws IOException
Execute the task.

Throws:
IOException

execute

void execute()
Execute this task by using the associated ExecutorService. If the ExecutorService is null, the task's doTask() method will be invoked.


getConnection

Connection getConnection()

setConnection

void setConnection(Connection connection)

recycle

void recycle()
Recycle this task.


setThreadPool

void setThreadPool(ExecutorService threadPool)
Set the thread pool on which Worker Threads will synchronize.


getThreadPool

ExecutorService getThreadPool()
Return the thread pool used by this object.



Copyright © 2009 SUN Microsystems. All Rights Reserved.