|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
class |
SocketManager.ReadTask
The task managing the socket read thread |
class |
SocketManager.WriteTask
The task managing the socket write thread |
Constructor Summary | |
SocketManager(Socket s)
|
Method Summary | |
void |
sendMessage(BaseMsg msg)
Send a two-way message and block the calling thread until the msg reply is received. |
void |
sendReply(BaseMsg 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 handler)
Set the callback handler for msgs that were not originated by the socket manager. |
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". |
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(Socket s) throws IOException
Method Detail |
public void start(ThreadGroup tg)
tg
- the thread group to use for the read and write threads.public void stop()
public void setHandler(SocketManagerHandler 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 msg) throws Exception
msg
- the request msg to send
Exception
- thrown if the reply message has an error valuepublic void sendReply(BaseMsg msg) throws Exception
msg
-
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |