Top Fields Constructors Methods
org.glassfish.grizzly.threadpool

public Class GrizzlyExecutorService

extends AbstractExecutorService
implements MonitoringAware<ThreadPoolProbe>
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.monitoring.MonitoringAware
Imports
java.util.List, .Queue, java.util.concurrent.AbstractExecutorService, .BlockingQueue, .TimeUnit, org.glassfish.grizzly.memory.MemoryManager, org.glassfish.grizzly.monitoring.MonitoringAware, .MonitoringConfig

Author
gustav trede

Field Summary

Modifier and TypeField and Description
protected volatile ThreadPoolConfig
private volatile AbstractThreadPool
private final Object

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
awaitTermination(long timeout, TimeUnit 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 static GrizzlyExecutorService
public static GrizzlyExecutorService
public void
execute(Runnable r)

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.

public ThreadPoolConfig
public MonitoringConfig<ThreadPoolProbe>
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 GrizzlyExecutorService
protected final void
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.

Inherited from java.util.concurrent.AbstractExecutorService:
invokeAllinvokeAllinvokeAnyinvokeAnynewTaskFornewTaskForsubmitsubmitsubmit

Field Detail

configback to summary
protected volatile ThreadPoolConfig config
poolback to summary
private volatile AbstractThreadPool pool
statelockback to summary
private final Object statelock

Constructor Detail

GrizzlyExecutorServiceback to summary
protected GrizzlyExecutorService(ThreadPoolConfig config)

Method Detail

awaitTerminationback to summary
public boolean awaitTermination(long timeout, 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.

Annotations
@Override
Exceptions
InterruptedException:
if interrupted while waiting
createInstanceback to summary
public static GrizzlyExecutorService createInstance()
Returns:GrizzlyExecutorService

GrizzlyExecutorService

createInstanceback to summary
public static GrizzlyExecutorService createInstance(ThreadPoolConfig cfg)
Parameters
cfg:ThreadPoolConfig

ThreadPoolConfig

Returns:GrizzlyExecutorService

GrizzlyExecutorService

executeback to summary
public void execute(Runnable r)

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.

Annotations
@Override
getConfigurationback to summary
public ThreadPoolConfig getConfiguration()
Returns:ThreadPoolConfig

config - ThreadPoolConfig

getMonitoringConfigback to summary
public MonitoringConfig<ThreadPoolProbe> getMonitoringConfig()

Implements org.glassfish.grizzly.monitoring.MonitoringAware.getMonitoringConfig.

Doc from org.glassfish.grizzly.monitoring.MonitoringAware.getMonitoringConfig.

Return the object associated MonitoringConfig.

Annotations
@Override
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.

Annotations
@Override
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.

Annotations
@Override
reconfigureback to summary
public GrizzlyExecutorService reconfigure(ThreadPoolConfig config)

Sets the ThreadPoolConfig

Returns:GrizzlyExecutorService

returns GrizzlyExecutorService

setImplback to summary
protected final void setImpl(ThreadPoolConfig cfg)
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.

Annotations
@Override
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.

Annotations
@Override