org.jboss.invocation.pooled.server
Class ServerThread
java.lang.Object
java.lang.Thread
org.jboss.invocation.pooled.server.ServerThread
- All Implemented Interfaces:
- java.lang.Runnable
- public class ServerThread
- extends java.lang.Thread
This Thread object hold a single Socket connection to a client
and is kept alive until a timeout happens, or it is aged out of the
PooledInvoker's LRU cache.
There is also a separate thread pool that is used if the client disconnects.
This thread/object is re-used in that scenario and that scenario only.
This class will demarshal then delegate to PooledInvoker for invocation.
*NOTES* ObjectStreams were found to be better performing than the Custom marshalling
done by the TrunkInvoker.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 |
in
protected java.io.ObjectInputStream in
out
protected java.io.ObjectOutputStream out
socket
protected java.net.Socket socket
invoker
protected PooledInvoker (src) invoker
clientpool
protected LRUPool (src) clientpool
threadpool
protected java.util.LinkedList threadpool
running
protected volatile boolean running
handlingResponse
protected volatile boolean handlingResponse
shutdown
protected volatile boolean shutdown
id
protected static int id
ServerThread
public ServerThread(java.net.Socket socket,
PooledInvoker (src) invoker,
LRUPool (src) clientpool,
java.util.LinkedList threadpool,
int timeout)
throws java.lang.Exception
nextID
public static int nextID()
shutdown
public void shutdown()
evict
public void evict()
wakeup
public void wakeup(java.net.Socket socket,
int timeout)
throws java.lang.Exception
- Throws:
java.lang.Exception
run
public void run()
acknowledge
protected void acknowledge()
throws java.lang.Exception
- Throws:
java.lang.Exception
processInvocation
protected void processInvocation()
throws java.lang.Exception
- Throws:
java.lang.Exception
dorun
protected void dorun()
- This is needed because Object*Streams leak