|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.ow2.petals.container.thread.AbstractThread
public abstract class AbstractThread
This class is the parent class for managing tasks to perform on Components, Bootstrap and ServiceAssemblies. Tasks on those objects are performed in a dedicated thread, preventing the main thread to be blocked. When a timeout exceeds on an action, the task is considered as blocked, and an exception is thrown
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected javax.jbi.JBIException |
jbiException
Exception thrown when a task failed in its own thread. |
protected org.ow2.petals.util.LoggingUtil |
logger
|
protected java.util.concurrent.BlockingQueue<java.lang.String> |
requestQueue
The blocking working queue is equal to a FIFO. |
protected java.util.concurrent.BlockingQueue<java.lang.String> |
responseQueue
The response queue used to wait for the task to complete. |
static java.lang.String |
SHUTDOWNTHREAD
Shutdown thread action |
protected long |
timeout
Time before an action is considered as blocked Exception is thrown when this time exceed |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AbstractThread(long taskTimeout,
org.ow2.petals.util.LoggingUtil logger)
Creates a new instance of AbstractThread |
|
| Method Summary | |
|---|---|
protected abstract boolean |
doTask(java.lang.String action)
Execute the task in the dedicated thread. |
protected void |
execute(java.lang.String action)
Execute the action. |
void |
run()
|
void |
shutdownThread()
Shutdown the current thread |
| 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected javax.jbi.JBIException jbiException
protected java.util.concurrent.BlockingQueue<java.lang.String> requestQueue
protected java.util.concurrent.BlockingQueue<java.lang.String> responseQueue
public static final java.lang.String SHUTDOWNTHREAD
protected final org.ow2.petals.util.LoggingUtil logger
protected long timeout
| Constructor Detail |
|---|
public AbstractThread(long taskTimeout,
org.ow2.petals.util.LoggingUtil logger)
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected abstract boolean doTask(java.lang.String action)
protected void execute(java.lang.String action)
throws javax.jbi.JBIException
action -
javax.jbi.JBIException
public void shutdownThread()
throws javax.jbi.JBIException
javax.jbi.JBIException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||