5 Replies Latest reply on Nov 13, 2006 2:28 PM by Oleg Zhurakousky

    Implementing our own Client side interceptors

    Anvar Ansar Newbie

      I have a requirement in jbossmq, where I have to implement and deploy our own client-side JBossMQ interceptors?
      Is there any way to achieve this.

        • 1. Re: Implementing our own Client side interceptors
          Oleg Zhurakousky Newbie

          There is no client side interceptors in JBossMQ.
          However, you can use any AOP framework (i.e. JBossAOP etc.) to aspectize (write an interceptor or an aspect) your class (which I assume could be JMS client).

          Regards

          • 2. Re: Implementing our own Client side interceptors
            Anvar Ansar Newbie

            Following is my understading.
            They need to be AOP interceptors (implement org.jboss.aop.advice.Interceptor). Also, an AOP configuration file that specifies the AOP bindings must be available in the client classpath.

            Please correct me if my undersanding is wrong.

            Thanks.

            • 3. Re: Implementing our own Client side interceptors
              Oleg Zhurakousky Newbie

              You can use any AOP framework (i.e., AspectJ etc). What I was trying to say, there is no JBoss provided Client Container(Proxy) with a configurable interceptor stack, something you see in JBoss EJB implementation where you have concepts like "Client Side" and "Server Side" with coresponding configurations and interceptor stack.

              For everything else you are correct.

              Regards

              • 4. Re: Implementing our own Client side interceptors
                Anvar Ansar Newbie

                Thanks a lot for the information.

                By the same way, if I have to implement and deploy my own server side JBOSSMQ interceptors, should I have to implement org.jboss.mq.server.JMSServerInterceptor or extend org.jboss.mq.server.JMSServerInterceptorSupport, that are deployed as a JBoss service and added to the interceptor chain declaration in jbossmq-service.xml.

                Thanks

                • 5. Re: Implementing our own Client side interceptors
                  Oleg Zhurakousky Newbie

                  If I understand your question correctly, you somewhat answered it yourself.
                  As far as basic java rule of thumb, if you can reuse some of the functionality, then "extend", otherwise "re-implement". However, since you are providing another interceptor your inharitance comes from adding (before, in-between or after) to already existing interceptor stack. So I would say write your own interceptor, deside where you want to stick it and that is all you have to do.

                  As far as making it as Jboss service is entirely up to you. In other words if you want it to be managed then yes make an MBean out of it, if not, then jaring your interceptor class and throwing it in the lib directory will do (providing you specify implementation in the server interceptor stack)