|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
fabric.common.FabricThread.AbstractImpl
fabric.common.AbstractMessageHandlerThread<Session,MessageHandlerThread>
public abstract class AbstractMessageHandlerThread<Session extends AbstractMessageHandlerThread.SessionAttributes,MessageHandlerThread extends AbstractMessageHandlerThread<Session,MessageHandlerThread>>
Abstracts a message-handler thread for processing messages. This implements FabricThread for performance reasons. It will be calling into the in-process worker to perform access control.
Nested Class Summary | |
---|---|
protected static interface |
AbstractMessageHandlerThread.Factory<MessageHandlerThread extends AbstractMessageHandlerThread<?,MessageHandlerThread>>
|
static class |
AbstractMessageHandlerThread.Pool<MessageHandlerThread extends AbstractMessageHandlerThread<?,MessageHandlerThread>>
|
static class |
AbstractMessageHandlerThread.SessionAttributes
|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Nested classes/interfaces inherited from interface fabric.common.FabricThread |
---|
FabricThread.AbstractImpl |
Field Summary | |
---|---|
protected AbstractMessageHandlerThread.Pool<MessageHandlerThread> |
pool
The pool that we are a part of. |
protected Session |
session
The session for which requests are being handled. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
AbstractMessageHandlerThread(java.lang.String name,
AbstractMessageHandlerThread.Pool<MessageHandlerThread> pool)
|
Method Summary | |
---|---|
void |
associateSession(Session session)
Initialises this message handler to handle the given session and signals this thread to start processing the worker's requests. |
Session |
getSession()
|
void |
recycle()
Interrupts this thread from service and puts it back in its thread pool. |
void |
run()
The main execution body of the message-handler thread. |
protected boolean |
shuttingDown()
Determines whether the thread should shut down. |
java.nio.channels.Pipe.SinkChannel |
sink()
|
java.nio.channels.Pipe.SourceChannel |
source()
|
Methods inherited from class fabric.common.FabricThread.AbstractImpl |
---|
getTransactionManager, setTransactionManager |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final AbstractMessageHandlerThread.Pool<MessageHandlerThread extends AbstractMessageHandlerThread<Session,MessageHandlerThread>> pool
protected Session extends AbstractMessageHandlerThread.SessionAttributes session
Constructor Detail |
---|
protected AbstractMessageHandlerThread(java.lang.String name, AbstractMessageHandlerThread.Pool<MessageHandlerThread> pool)
Method Detail |
---|
public final void run()
run_
to ensure that all exceptions are properly handled
and that the Node
is properly notified when this handler is
finished with a worker.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected boolean shuttingDown()
public final Session getSession()
public final void associateSession(Session session)
ConnectionHandler.CallbackHandler
to hand off a worker request
to this handler.
public final void recycle()
public java.nio.channels.Pipe.SourceChannel source()
public java.nio.channels.Pipe.SinkChannel sink()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |