Top Description Fields Constructors Methods
org.jboss.threads

pack-priv Class DelegatingExecutorService

extends AbstractExecutorService
implements ExecutorService
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ExecutorService, java.lang.AutoCloseable, java.util.concurrent.Executor
Known Direct Subclasses
org.jboss.threads.DelegatingScheduledExecutorService
Imports
java.util.concurrent.ExecutorService, .TimeUnit, .AbstractExecutorService, .Executor, java.util.List

An implementation of ExecutorService that delegates to the real executor, while disallowing termination.

Field Summary

Modifier and TypeField and Description
private final Executor

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
awaitTermination(final long
the maximum time to wait
timeout
,
final TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
public void
execute(final Runnable
the runnable task
command
)

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.
public boolean
isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.
public boolean
isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down.
public void
shutdown()

Implements java.util.concurrent.ExecutorService.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
public List<Runnable>
shutdownNow()

Implements java.util.concurrent.ExecutorService.shutdownNow.

Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.util.concurrent.AbstractExecutorService:
invokeAllinvokeAllinvokeAnyinvokeAnynewTaskFornewTaskForsubmitsubmitsubmit

Field Detail

delegateback to summary
private final Executor delegate

Constructor Detail

DelegatingExecutorServiceback to summary
pack-priv DelegatingExecutorService(final Executor delegate)

Method Detail

awaitTerminationback to summary
public boolean awaitTermination(final long timeout, final TimeUnit unit) throws InterruptedException

Implements java.util.concurrent.ExecutorService.awaitTermination.

Doc from java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Parameters
timeout:long

the maximum time to wait

unit:TimeUnit

the time unit of the timeout argument

Returns:boolean

true if this executor terminated and false if the timeout elapsed before termination

Exceptions
InterruptedException:
if interrupted while waiting
executeback to summary
public void execute(final Runnable command)

Implements java.util.concurrent.Executor.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

Parameters
command:Runnable

the runnable task

isShutdownback to summary
public boolean isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Doc from java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.

Returns:boolean

true if this executor has been shut down

isTerminatedback to summary
public boolean isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Doc from java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down. Note that isTerminated is never true unless either shutdown or shutdownNow was called first.

Returns:boolean

true if all tasks have completed following shut down

shutdownback to summary
public void shutdown()

Implements java.util.concurrent.ExecutorService.shutdown.

Doc from java.util.concurrent.ExecutorService.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.

This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.

shutdownNowback to summary
public List<Runnable> shutdownNow()

Implements java.util.concurrent.ExecutorService.shutdownNow.

Doc from java.util.concurrent.ExecutorService.shutdownNow.

Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.

This method does not wait for actively executing tasks to terminate. Use awaitTermination to do that.

There are no guarantees beyond best-effort attempts to stop processing actively executing tasks. For example, typical implementations will cancel via Thread#interrupt, so any task that fails to respond to interrupts may never terminate.

Returns:List<Runnable>

list of tasks that never commenced execution

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.