站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

ServerThread (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.invocation.pooled.server
Class ServerThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.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.1 $
Author:
Bill Burke

Field Summary
protected  LRUPool clientpool
           
protected  boolean handlingResponse
           
protected static int id
           
protected  ObjectInputStream in
           
protected  PooledInvoker invoker
           
protected  ObjectOutputStream out
           
protected  boolean running
           
protected  boolean shutdown
           
protected  Socket socket
           
protected  LinkedList threadpool
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerThread(Socket socket, PooledInvoker invoker, LRUPool clientpool, LinkedList threadpool, int timeout)
           
 
Method Summary
protected  void acknowledge()
           
protected  void dorun()
          This is needed because Object*Streams leak
 void evict()
           
static int nextID()
           
protected  void processInvocation()
           
 void run()
           
 void shutdown()
           
 void wakeup(Socket socket, int timeout)
           
 
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
 

Field Detail

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

id

protected static int id
Constructor Detail

ServerThread

public ServerThread(Socket socket,
                    PooledInvoker invoker,
                    LRUPool clientpool,
                    LinkedList threadpool,
                    int timeout)
             throws Exception
Method Detail

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()

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.