Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » mq » il » uil2 » [javadoc | source]
org.jboss.mq.il.uil2
public class: SocketManager [javadoc | source]
java.lang.Object
   org.jboss.mq.il.uil2.SocketManager
Used to manage the client/server and server/client communication in an asynchrounous manner.
Nested Class Summary:
public class  SocketManager.ReadTask  The task managing the socket read thread 
public class  SocketManager.WriteTask  The task managing the socket write thread 
static class  SocketManager.UILThreadFactory   
Field Summary
 NotifyingBufferedInputStream bufferedInput    The buffering for output 
 NotifyingBufferedOutputStream bufferedOutput    The buffering for output 
 PooledExecutor pool    The thread pool used to service incoming requests 
Constructor:
 public SocketManager(Socket s) throws IOException 
Method from org.jboss.mq.il.uil2.SocketManager Summary:
sendMessage,   sendOneWay,   sendReply,   setBufferSize,   setChunkSize,   setHandler,   start,   stop
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.mq.il.uil2.SocketManager Detail:
 public  void sendMessage(BaseMsg msg) throws Exception 
    Send a two-way message and block the calling thread until the msg reply is received. This enques the msg to the sendQueue, places the msg in the replyMap and waits on the msg. The msg is notified by the read task thread when it finds a msg with a msgID that maps to the msg in the msgReply map.
 public  void sendOneWay(BaseMsg msg) throws Exception 
    Send a one-way.
 public  void sendReply(BaseMsg msg) throws Exception 
    Send a reply.
 public  void setBufferSize(int size) 
    Sets the buffer size
 public  void setChunkSize(int size) 
    Sets the chunk size
 public  void setHandler(SocketManagerHandler handler) 
    Set the callback handler for msgs that were not originated by the socket manager. This is any msgs read that was not sent via the sendMessage method.
 public  void start(ThreadGroup tg) 
    Start the read and write threads using the given thread group and names of "UIL2.SocketManager.ReadTask" and "UIL2.SocketManager.WriteTask".
 public  void stop() 
    Stop the read and write threads by interrupting them.