org.glassfish.grizzly.threadpool
Class DefaultWorkerThread
java.lang.Object
java.lang.Thread
org.glassfish.grizzly.threadpool.DefaultWorkerThread
- All Implemented Interfaces:
- Runnable, AttributeStorage, WorkerThread
public class DefaultWorkerThread
- extends Thread
- implements WorkerThread
Default Grizzly worker thread implementation
- Author:
- Alexey Stashok
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from interface java.lang.Runnable |
run |
DefaultWorkerThread
public DefaultWorkerThread(AttributeBuilder attrBuilder,
String name,
ThreadLocalPool pool,
Runnable runTask)
getThread
public Thread getThread()
- Specified by:
getThread in interface WorkerThread
getAttributes
public AttributeHolder getAttributes()
- Description copied from interface:
AttributeStorage
- Get associated
AttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.
- Specified by:
getAttributes in interface AttributeStorage
- Returns:
- associated
AttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.
getMemoryPool
public ThreadLocalPool getMemoryPool()
takeFromCache
public final <E> E takeFromCache(ThreadCache.CachedTypeIndex<E> index)
putToCache
public final <E> boolean putToCache(ThreadCache.CachedTypeIndex<E> index,
E o)
getTransactionTimeout
public long getTransactionTimeout(TimeUnit timeunit)
- Specified by:
getTransactionTimeout in interface WorkerThread
setTransactionTimeout
public void setTransactionTimeout(long timeout,
TimeUnit timeunit)
- Specified by:
setTransactionTimeout in interface WorkerThread
getTransactionStartedTime
public long getTransactionStartedTime(TimeUnit timeunit)
onBeforeRun
protected void onBeforeRun()
onAfterRun
protected void onAfterRun()
isSelectorThread
public boolean isSelectorThread()
- Specified by:
isSelectorThread in interface WorkerThread
setSelectorThread
public void setSelectorThread(boolean isSelectorThread)
- Specified by:
setSelectorThread in interface WorkerThread
Copyright © 2011 Oracle Corpration. All Rights Reserved.