[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: New wireformat and client side remoting
jmesnil
do-not-reply at jboss.com
Mon Nov 5 11:41:50 EST 2007
"timfox" wrote : More thoughts, how this might look:
|
| abstract class Packet
| {
| long correlationID;
| }
|
| interface Dispatcher
| {
| Handler registerHandler(int handlerID);
|
| void sendOneWay(Packet packet, int handlerID);
|
| void sendBlocking(Packet packet, int handlerID);
| }
|
| interface Handler
| {
| void handle(Message message);
| }
|
I have a simple prototype which is quite similar:
| interface Packet
| {
| long correlationID;
| String handlerID;
| }
|
| class CreateSessionRequest extends Packet {
| }
| class CreateSessionResponse extends Packet {
| }
|
| interface Client
| {
| Handler registerHandler(int handlerID, Handler handler);
| void unregisterHandler(int handlerID);
|
| void sendOneWay(Packet packet);
|
| Packet sendBlocking(Packet packet);
| }
|
| interface Handler
| {
| void handle(Packet packet);
| }
|
* to send a message and forget it: sendOneWay(message)
| * to send a packet and be notified later on: register the handler, set the handlerID on the packet and send it one way. Handler will be called back sometimes later.
| * to send a message and block until the response arrives: Packet response = sendBlocking(request)
|
anonymous wrote :
| Here are some examples of usage:
| ...
|
I'm writing unit tests based on this simple API to check what we need to cover to integrate MINA into JBoss Messaging.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101887#4101887
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101887
More information about the jboss-dev-forums
mailing list