org.openejb.ri.server
Class Server.SocketHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.openejb.ri.server.Server.SocketHandler
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Server

public class Server.SocketHandler
extends java.lang.Thread

This inner class defines objects that manage a connection from a EJBHome or EJBObject proxy on a client. Its dedicated to one proxy and process all requests from that proxy. This object runs in its own thread responding to data streamed to it from the proxy.


Field Summary
(package private)  java.net.Socket mySocket
          The socket that is dedicated to this SocketHandler
(package private)  java.io.ObjectInputStream ois
          The ObjectInputStream used to receive incoming messages from the client.
(package private)  java.io.ObjectOutputStream oos
          The ObjectOutputStream used to send outgoing response messages to the client.
 
Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
 
Constructor Summary
Server.SocketHandler(java.net.Socket socket)
          Constructs a SocketHandler with an ObjectOutputStream and an ObjectInputStream for receiving and responding to requests made by the proxy connected to the socket.
 
Method Summary
 void run()
          Responds to requests made by the proxy.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, 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

mySocket

java.net.Socket mySocket
The socket that is dedicated to this SocketHandler

ois

java.io.ObjectInputStream ois
The ObjectInputStream used to receive incoming messages from the client.

oos

java.io.ObjectOutputStream oos
The ObjectOutputStream used to send outgoing response messages to the client.
Constructor Detail

Server.SocketHandler

public Server.SocketHandler(java.net.Socket socket)
                     throws java.lang.Exception
Constructs a SocketHandler with an ObjectOutputStream and an ObjectInputStream for receiving and responding to requests made by the proxy connected to the socket. The constructor starts the thread.
Parameters:
socket -  
Throws:
java.lang.Exception -  
Method Detail

run

public void run()
Responds to requests made by the proxy. Request are method invocations made on the proxy and packaged into a MethodInvocation object which is serialized through the socket and handled hear. All EJBObject.class and EJBHome.class methods are partially processed by the server and partially by the container. All business methods are simply delegated to the container.
Overrides:
run in class java.lang.Thread