| |
|
| java.lang.Object org.jboss.mq.il.uil2.SocketManager
SocketManager | public class SocketManager (Code) | | Used to manage the client/server and server/client communication in an
asynchrounous manner.
author: Scott.Stark@jboss.org version: $Revision: 57198 $ |
Inner Class :public class ReadTask implements Runnable | |
Inner Class :public class WriteTask implements Runnable | |
Inner Class :static class UILThreadFactory implements ThreadFactory | |
Method Summary | |
public void | sendMessage(BaseMsg msg) Send a two-way message and block the calling thread until the
msg reply is received. | public void | sendOneWay(BaseMsg msg) Send a one-way. | public void | sendReply(BaseMsg msg) Send a reply. | public void | setBufferSize(int size) | public void | setChunkSize(int size) | public void | setHandler(SocketManagerHandler handler) Set the callback handler for msgs that were not originated by the
socket manager. | 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. |
bufferedInput | NotifyingBufferedInputStream bufferedInput(Code) | | The buffering for output
|
bufferedOutput | NotifyingBufferedOutputStream bufferedOutput(Code) | | The buffering for output
|
pool | PooledExecutor pool(Code) | | The thread pool used to service incoming requests
|
sendMessage | public void sendMessage(BaseMsg msg) throws Exception(Code) | | 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.
Parameters: msg - the request msg to send throws: Exception - thrown if the reply message has an error value |
setBufferSize | public void setBufferSize(int size)(Code) | | Sets the buffer size
Parameters: size - the size of the buffer |
setChunkSize | public void setChunkSize(int size)(Code) | | Sets the chunk size
Parameters: size - the size of a chunk |
setHandler | public void setHandler(SocketManagerHandler handler)(Code) | | 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.
Parameters: handler - |
start | public void start(ThreadGroup tg)(Code) | | Start the read and write threads using the given thread group and
names of "UIL2.SocketManager.ReadTask" and "UIL2.SocketManager.WriteTask".
Parameters: tg - the thread group to use for the read and write threads. |
stop | public void stop()(Code) | | Stop the read and write threads by interrupting them.
|
|
|
|