public class ScheduledThreadPool extends java.lang.Object implements java.util.concurrent.ScheduledExecutorService, EnvironmentListener, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until the tasks complete.
|
void |
environmentBind(EnvironmentClassLoader loader)
Called when the environment bind phase
|
void |
environmentConfigure(EnvironmentClassLoader loader)
Called when the environment config phase
|
void |
environmentStart(EnvironmentClassLoader loader)
Called when the environment starts.
|
void |
environmentStop(EnvironmentClassLoader loader)
Called when the environment stops.
|
void |
execute(java.lang.Runnable command)
Launches a thread to execute a command.
|
static ScheduledThreadPool |
getLocal() |
java.util.Timer |
getTimer()
Returns the Timer for this pool.
|
java.util.List |
invokeAll(java.util.Collection tasks)
Invokes a set of tasks.
|
java.util.List |
invokeAll(java.util.Collection tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes a set of tasks.
|
java.lang.Object |
invokeAny(java.util.Collection tasks)
Invokes a set of tasks.
|
java.lang.Object |
invokeAny(java.util.Collection tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes a set of tasks.
|
boolean |
isShutdown()
Return true if the executor is shut down.
|
boolean |
isTerminated()
Return true if the executor has completed shutting down.
|
<V> java.util.concurrent.ScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules a future task.
|
java.util.concurrent.ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules a future task.
|
java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules a future task.
|
java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules with fixed delay
|
void |
shutdown()
Starts the shutdown.
|
java.util.List<java.lang.Runnable> |
shutdownNow()
Starts the shutdown.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task)
Submits a task for execution.
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable command)
Submits a task for execution.
|
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result)
Submits a task for execution.
|
java.lang.String |
toString() |
java.lang.Object |
writeReplace()
Serialize to a webbeans handle
|
public static ScheduledThreadPool getLocal()
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
awaitTermination
in interface java.util.concurrent.ExecutorService
public java.util.List invokeAll(java.util.Collection tasks)
invokeAll
in interface java.util.concurrent.ExecutorService
public java.util.List invokeAll(java.util.Collection tasks, long timeout, java.util.concurrent.TimeUnit unit)
invokeAll
in interface java.util.concurrent.ExecutorService
public java.lang.Object invokeAny(java.util.Collection tasks)
invokeAny
in interface java.util.concurrent.ExecutorService
public java.lang.Object invokeAny(java.util.Collection tasks, long timeout, java.util.concurrent.TimeUnit unit)
invokeAny
in interface java.util.concurrent.ExecutorService
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
public java.util.concurrent.Future<?> submit(java.lang.Runnable command)
submit
in interface java.util.concurrent.ExecutorService
public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService
public java.util.Timer getTimer()
public void environmentConfigure(EnvironmentClassLoader loader)
environmentConfigure
in interface EnvironmentListener
public void environmentBind(EnvironmentClassLoader loader)
environmentBind
in interface EnvironmentListener
public void environmentStart(EnvironmentClassLoader loader)
environmentStart
in interface EnvironmentListener
public void environmentStop(EnvironmentClassLoader loader)
environmentStop
in interface EnvironmentListener
public java.lang.Object writeReplace()
public java.lang.String toString()
toString
in class java.lang.Object