org.jboss.invocation.pooled.server
Class ServerThread
java.lang.Object
java.lang.Thread
org.jboss.invocation.pooled.server.ServerThread
- All Implemented Interfaces:
- Runnable
public class ServerThread
- extends 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.
- Version:
- $Revision: 1.6.6.4 $
- Author:
- Bill Burke, Scott.Stark@jboss.org
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 |
in
protected ObjectInputStream in
out
protected ObjectOutputStream out
socket
protected Socket socket
invoker
protected PooledInvoker invoker
clientpool
protected LRUPool clientpool
threadpool
protected LinkedList threadpool
running
protected volatile boolean running
handlingResponse
protected volatile boolean handlingResponse
shutdown
protected volatile boolean shutdown
trace
protected boolean trace
id
protected static int id
ServerThread
public ServerThread(Socket socket,
PooledInvoker invoker,
LRUPool clientpool,
LinkedList threadpool,
int timeout)
throws Exception
- Throws:
Exception
nextID
public static int nextID()
shutdown
public void shutdown()
evict
public void evict()
wakeup
public void wakeup(Socket socket,
int timeout)
throws Exception
- Throws:
Exception
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
acknowledge
protected void acknowledge()
throws Exception
- Throws:
Exception
processInvocation
protected void processInvocation()
throws Exception
- Throws:
Exception
dorun
protected void dorun()
- This is needed because Object*Streams leak
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.