[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: JBMESSAGING-1225 - PacketFilters implementation

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Jan 29 10:50:17 EST 2008


anonymous wrote : Remember though that we won't always be running with the MC, e.g. OEM customers running embedded and directly instantiating our POJOs, so the functionality needs to work with or without the MC being available.
  | 

A simple call to MinaServrice.addFilter (or interceptor case we rename it, should be enough). We have a way around it, and it would be easy either way. 


anonymous wrote : Also not sure why we need PacketHandler and PacketSender passed into the method, surely:
  | 


It would be useful when you want to intercept the return value of the Handler. If we had the intercept working on both ways (client2Server and server2Client, you would never had the context of the return inside the same method). This would be like the ServletFilter where you have the InputStream and OutputStream available on the call.

Case you wanted to override a return, you could something like:


public void intercept(Packet packet, Handler handler, final Sender sender)
  | {
  |           handler.handle(packet, new Sender() {
  |                                                 public void send(Packet packet)
  |                                                  {
  |                                                     sentPacket = packet;
  |                                                     sender.sent(packet);
  |                                                  }
  |                                              };
  | }
  | 

It would be harder to associate the sent and returned packet without this context.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124454#4124454

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124454



More information about the jboss-dev-forums mailing list