站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

ThreadPool (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.threadpool
Interface ThreadPool

All Known Implementing Classes:
BasicThreadPool

public interface ThreadPool

A thread pool.

Version:
$Revision: 1.3.2.1 $
Author:
Adrian Brock

Method Summary
 void run(Runnable runnable)
          Run a runnable
 void run(Runnable runnable, long startTimeout, long completeTimeout)
           
 void runTask(Task task)
          Run a task
 void runTaskWrapper(TaskWrapper wrapper)
          Run a task wrapper
 void stop(boolean immediate)
          Stop the pool
 void waitForTasks()
          Wait on the queued tasks to complete.
 void waitForTasks(long maxWaitTime)
          Wait on the queued tasks to complete upto maxWaitTime milliseconds.
 

Method Detail

stop

public void stop(boolean immediate)
Stop the pool

Parameters:
immediate - whether to shutdown immediately

waitForTasks

public void waitForTasks()
                  throws InterruptedException
Wait on the queued tasks to complete. This can only be called after after stop.

Throws:
InterruptedException

waitForTasks

public void waitForTasks(long maxWaitTime)
                  throws InterruptedException
Wait on the queued tasks to complete upto maxWaitTime milliseconds. This can only be called after after stop.

Parameters:
maxWaitTime -
Throws:
InterruptedException

runTaskWrapper

public void runTaskWrapper(TaskWrapper wrapper)
Run a task wrapper

Parameters:
wrapper - the task wrapper

runTask

public void runTask(Task task)
Run a task

Parameters:
task - the task
Throws:
IllegalArgumentException - for a null task

run

public void run(Runnable runnable)
Run a runnable

Parameters:
runnable - the runnable
Throws:
IllegalArgumentException - for a null runnable

run

public void run(Runnable runnable,
                long startTimeout,
                long completeTimeout)
Parameters:
runnable -
startTimeout -
completeTimeout -


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.