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

clebert.suconic@jboss.com do-not-reply at jboss.com
Mon Jan 28 22:12:06 EST 2008


I'm adding the capability of intercepting packets on ServerSide, right before sending those to the packetHandler.

This is a higher level functionality than the one provided by Mina, and this is how it works:

A Customer can implement an interface defined by org.jboss.messaging.core.remoting.PacketFilter, example:

  | public class DummyFilter implements PacketFilter
  | {
  |    public boolean filterMessage(AbstractPacket packet, PacketHandler handler,
  |          PacketSender sender)
  |    {
  |         System.out.println("Packet " + packet + " intercepted);
  |         return true;
  |    }
  | 
  | }
  | 

And by simply deploying the DummyFilter on the MicroContainer (anyway you want) will be enough to wire it on the MinaService, done automagically by the MicroContainer.  (Thanks for Ales' help).


Example of a deployment descriptor:



  | <?xml version="1.0" encoding="UTF-8"?>
  | <deployment xmlns="urn:jboss:bean-deployer:2.0">
  |          <bean name="MyFilter" class="a.b.DummyFilter"/>
  | </deployment>
  | 


Also, to support testing of this method, I have added back few deploy and undeploy methods to our Servers/Bootstrapserver.

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

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



More information about the jboss-dev-forums mailing list