|
JBoss Threads 2.0.0.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
org.jboss.threads.QueuelessExecutor
public final class QueuelessExecutor
A queueless thread pool. If one or more threads are waiting for work when a task is submitted, it will be used. Otherwise, if fewer than the maximum threads are started, a new thread is created.
| Constructor Summary | |
|---|---|
QueuelessExecutor(ThreadFactory threadFactory,
DirectExecutor taskExecutor,
Executor handoffExecutor,
long keepAliveTime)
|
|
| Method Summary | ||
|---|---|---|
|
addShutdownListener(EventListener<A> shutdownListener,
A attachment)
Add a shutdown listener. |
|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
|
|
void |
execute(Runnable task)
Executes the given command at some time in the future. |
|
void |
executeBlocking(Runnable task)
Execute a task, blocking until it can be accepted, or until the calling thread is interrupted. |
|
void |
executeBlocking(Runnable task,
long timeout,
TimeUnit unit)
Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted. |
|
void |
executeNonBlocking(Runnable task)
Execute a task, without blocking. |
|
int |
getCurrentThreadCount()
|
|
Executor |
getHandoffExecutor()
|
|
long |
getKeepAliveTime()
|
|
int |
getLargestThreadCount()
|
|
int |
getMaxThreads()
|
|
int |
getRejectedCount()
|
|
boolean |
isBlocking()
|
|
boolean |
isShutdown()
|
|
boolean |
isTerminated()
|
|
void |
setBlocking(boolean blocking)
|
|
void |
setHandoffExecutor(Executor handoffExecutor)
|
|
void |
setKeepAliveTime(long milliseconds)
|
|
void |
setMaxThreads(int newSize)
|
|
void |
shutdown()
|
|
List<Runnable> |
shutdownNow()
|
|
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.ExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit |
| Constructor Detail |
|---|
public QueuelessExecutor(ThreadFactory threadFactory,
DirectExecutor taskExecutor,
Executor handoffExecutor,
long keepAliveTime)
| Method Detail |
|---|
public int getMaxThreads()
getMaxThreads in interface ThreadPoolExecutorMBeanpublic void setMaxThreads(int newSize)
setMaxThreads in interface ThreadPoolExecutorMBeanpublic long getKeepAliveTime()
getKeepAliveTime in interface ThreadPoolExecutorMBeanpublic void setKeepAliveTime(long milliseconds)
setKeepAliveTime in interface ThreadPoolExecutorMBeanpublic int getCurrentThreadCount()
getCurrentThreadCount in interface ThreadExecutorMBeanpublic int getLargestThreadCount()
getLargestThreadCount in interface ThreadExecutorMBeanpublic int getRejectedCount()
getRejectedCount in interface ThreadExecutorMBeanpublic boolean isBlocking()
isBlocking in interface BoundedThreadPoolExecutorMBeanpublic void setBlocking(boolean blocking)
setBlocking in interface BoundedThreadPoolExecutorMBeanpublic Executor getHandoffExecutor()
public void setHandoffExecutor(Executor handoffExecutor)
public void shutdown()
shutdown in interface ExecutorService
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceInterruptedExceptionpublic List<Runnable> shutdownNow()
shutdownNow in interface ExecutorServicepublic boolean isShutdown()
isShutdown in interface ExecutorServicepublic boolean isTerminated()
isTerminated in interface ExecutorServicepublic void execute(Runnable task)
BlockingExecutor
execute in interface Executorexecute in interface BlockingExecutortask - the task to submit
public void executeBlocking(Runnable task)
throws RejectedExecutionException,
InterruptedException
BlockingExecutor
executeBlocking in interface BlockingExecutortask - the task to submit
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
InterruptedException - if the current thread was interrupted before the task could be accepted
public void executeBlocking(Runnable task,
long timeout,
TimeUnit unit)
throws RejectedExecutionException,
InterruptedException
BlockingExecutor
executeBlocking in interface BlockingExecutortask - the task to submittimeout - the amount of time to waitunit - the unit of time
ExecutionTimedOutException - if the timeout elapsed before a task could be accepted
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
InterruptedException - if the current thread was interrupted before the task could be accepted
public void executeNonBlocking(Runnable task)
throws RejectedExecutionException
BlockingExecutor
executeNonBlocking in interface BlockingExecutortask - the task to submit
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
public <A> void addShutdownListener(EventListener<A> shutdownListener,
A attachment)
addShutdownListener in interface ShutdownListenableA - the attachment typeshutdownListener - the listenerattachment - the attachment value to pass to the listener
|
JBoss Threads 2.0.0.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||