org.apache.axis2.transport.base.threads
Interface WorkerPool

All Known Implementing Classes:
NativeWorkerPool

public interface WorkerPool


Method Summary
 void execute(java.lang.Runnable task)
          Asynchronously execute the given task using one of the threads of the worker pool.
 int getActiveCount()
           
 int getQueueSize()
           
 void shutdown(int timeout)
          Destroy the worker pool.
 

Method Detail

execute

void execute(java.lang.Runnable task)
Asynchronously execute the given task using one of the threads of the worker pool. The task is expected to terminate gracefully, i.e. Runnable.run() should not throw an exception. Any uncaught exceptions should be logged by the worker pool implementation.

Parameters:
task - the task to execute

getActiveCount

int getActiveCount()

getQueueSize

int getQueueSize()

shutdown

void shutdown(int timeout)
              throws java.lang.InterruptedException
Destroy the worker pool. The pool will immediately stop accepting new tasks. All previously submitted tasks will be executed. The method blocks until all tasks have completed execution, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Parameters:
timeout - the timeout value in milliseconds
Throws:
java.lang.InterruptedException - if the current thread was interrupted while waiting for pending tasks to finish execution


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.