|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mq.il.uil2.SocketManager
Used to manage the client/server and server/client communication in an asynchrounous manner.
Nested Class Summary | |
class |
SocketManager.ReadTask (src)
The task managing the socket read thread |
class |
SocketManager.WriteTask (src)
The task managing the socket write thread |
Constructor Summary | |
SocketManager(java.net.Socket s)
|
Method Summary | |
void |
sendMessage(BaseMsg (src) msg)
Send a two-way message and block the calling thread until the msg reply is received. |
void |
sendReply(BaseMsg (src) msg)
Send a one-way message. |
void |
setBufferSize(int size)
Sets the buffer size |
void |
setChunkSize(int size)
Sets the chunk size |
void |
setHandler(SocketManagerHandler (src) handler)
Set the callback handler for msgs that were not originated by the socket manager. |
void |
start(java.lang.ThreadGroup tg)
Start the read and write threads using the given thread group and names of "UIL2.SocketManager.ReadTask" and "UIL2.SocketManager.WriteTask". |
void |
stop()
Stop the read and write threads by interrupting them. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SocketManager(java.net.Socket s) throws java.io.IOException
Method Detail |
public void start(java.lang.ThreadGroup tg)
tg
- the thread group to use for the read and write threads.public void stop()
public void setHandler(SocketManagerHandler (src) handler)
handler
- public void setBufferSize(int size)
size
- the size of the bufferpublic void setChunkSize(int size)
size
- the size of a chunkpublic void sendMessage(BaseMsg (src) msg) throws java.lang.Exception
msg
- the request msg to send
java.lang.Exception
- thrown if the reply message has an error valuepublic void sendReply(BaseMsg (src) msg) throws java.lang.Exception
msg
-
java.lang.Exception
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |