public class DefaultWorkerThread extends Thread implements WorkerThread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
UNLIMITED_TRANSACTION_TIMEOUT
Constructor and Description |
---|
DefaultWorkerThread(AttributeBuilder attrBuilder,
String name,
ThreadLocalPool pool,
Runnable runTask) |
Modifier and Type | Method and Description |
---|---|
AttributeHolder |
getAttributes()
Get associated
AttributeHolder . |
<E> E |
getFromCache(ThreadCache.CachedTypeIndex<E> index)
Get the cached object with the given type index from cache.
|
ThreadLocalPool |
getMemoryPool() |
Thread |
getThread() |
long |
getTransactionTimeout(TimeUnit timeunit) |
<E> boolean |
putToCache(ThreadCache.CachedTypeIndex<E> index,
E o) |
void |
setTransactionTimeout(long timeout,
TimeUnit timeunit) |
<E> E |
takeFromCache(ThreadCache.CachedTypeIndex<E> index)
Take the cached object with the given type index from cache.
|
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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
destroy, getName, start, stop
public DefaultWorkerThread(AttributeBuilder attrBuilder, String name, ThreadLocalPool pool, Runnable runTask)
public Thread getThread()
getThread
in interface WorkerThread
public AttributeHolder getAttributes()
AttributeStorage
AttributeHolder
.
Implementation may return null if AttributeHolder
wasn't
initialized yet.getAttributes
in interface AttributeStorage
AttributeHolder
.
Implementation may return null if AttributeHolder
wasn't
initialized yet.public ThreadLocalPool getMemoryPool()
public final <E> E getFromCache(ThreadCache.CachedTypeIndex<E> index)
takeFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex)
, the
object won't be removed from cache.E
- index
- the cached object type index.public final <E> E takeFromCache(ThreadCache.CachedTypeIndex<E> index)
getFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex)
, the
object will be removed from cache.E
- index
- the cached object type index.public final <E> boolean putToCache(ThreadCache.CachedTypeIndex<E> index, E o)
public long getTransactionTimeout(TimeUnit timeunit)
getTransactionTimeout
in interface WorkerThread
public void setTransactionTimeout(long timeout, TimeUnit timeunit)
setTransactionTimeout
in interface WorkerThread
Copyright © 2014 Oracle Corporation. All rights reserved.