Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected static int |
nextThreadID |
protected ThreadPool |
pool |
protected Runnable |
runObj
The runnable to run
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
PoolableThread(ThreadPool pool)
A thread that is a good pool citizen.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanStop()
Set a flag to stop this thread, after a run.
|
void |
clearResources()
Clears the resource cache
|
void |
execute(Runnable runnable)
Define what to run, and wake up this dozing thread
|
int |
getID()
Return my id
|
Object |
getResource(Object key)
Return the resource for the specified key
|
boolean |
isReady() |
void |
joinResource()
Waits for the resource to complete
|
Object |
putResource(Object key,
Object value)
Return the resource for the specified key
|
void |
run()
Wait in the pool, until someone needs this thread, then reenter pool.
|
void |
stopExecution()
Stop the thread's execution by interrupting it without marking the flag as not alive
|
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected static int nextThreadID
protected final ThreadPool pool
protected Runnable runObj
public PoolableThread(ThreadPool pool)
public boolean isReady()
public void joinResource() throws InterruptedException
InterruptedException
public final void run()
execute
instead.public void execute(Runnable runnable) throws IllegalStateException
IllegalStateException
public void cleanStop()
public void stopExecution()
public int getID()
public Object putResource(Object key, Object value)
public void clearResources()
Copyright © GigaSpaces.