org.glassfish.grizzly.threadpool
Class DefaultThreadPool
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.glassfish.grizzly.threadpool.DefaultThreadPool
- All Implemented Interfaces:
- Thread.UncaughtExceptionHandler, Executor, ExecutorService, ExtendedThreadPool
public class DefaultThreadPool
- extends ThreadPoolExecutor
- implements ExtendedThreadPool, Thread.UncaughtExceptionHandler
Thread Pool implementation, based on ThreadPoolExecutor
- Author:
- Alexey Stashok
| Methods inherited from class java.util.concurrent.ThreadPoolExecutor |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated |
| Methods inherited from interface org.glassfish.grizzly.threadpool.ExtendedThreadPool |
getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getTaskCount, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize |
attributeBuilder
protected AttributeBuilder attributeBuilder
- AttributeBuilder to index WorkerThread attributes
DefaultThreadPool
public DefaultThreadPool()
DefaultThreadPool
public DefaultThreadPool(int corePoolSize,
int maximumPoolSize,
int maxTasksCount,
long keepAliveTime,
TimeUnit unit)
getQueuedTasksCount
public int getQueuedTasksCount()
getMaxQueuedTasksCount
public int getMaxQueuedTasksCount()
setMaxQueuedTasksCount
public void setMaxQueuedTasksCount(int maxTasksCount)
getName
public String getName()
- Specified by:
getName in interface ExtendedThreadPool
setName
public void setName(String name)
- Specified by:
setName in interface ExtendedThreadPool
getQueueSize
public int getQueueSize()
- Description copied from interface:
ExtendedThreadPool
- Returns the number of tasks, which are currently waiting in the queue.
- Specified by:
getQueueSize in interface ExtendedThreadPool
- Returns:
- the number of tasks, which are currently waiting in the queue.
start
public void start()
stop
public void stop()
getAttributeBuilder
public AttributeBuilder getAttributeBuilder()
- Specified by:
getAttributeBuilder in interface ExtendedThreadPool
setAttributeBuilder
public void setAttributeBuilder(AttributeBuilder attributeBuilder)
- Specified by:
setAttributeBuilder in interface ExtendedThreadPool
uncaughtException
public void uncaughtException(Thread thread,
Throwable throwable)
- Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler
beforeExecute
protected void beforeExecute(Thread t,
Runnable r)
- Overrides:
beforeExecute in class ThreadPoolExecutor
afterExecute
protected void afterExecute(Runnable r,
Throwable t)
- Overrides:
afterExecute in class ThreadPoolExecutor
Copyright © 2009 SUN Microsystems. All Rights Reserved.