2 Replies Latest reply on Apr 26, 2008 12:51 AM by ron_sigal

    How to add ConnectionListener in JBoss ?

    rhodan76

      Hello,

      i'm currently evaluating jboss-remoting for our project. Therefore i tried to implement a server-side connection listener. I understand, that i declarative can configure and deploy a (socket-) connector via jboss-service.xml or an own *-service.xml.

      But how can i bind MyOwnConnectionListener.class as a listener to this connector ? The documentation says only that it's not possible via xml. But what's then the alternative in jboss ? How can i get inside my beans a instance of the deployed remoting-service/connector to add the listener?

        • 1. Re: How to add ConnectionListener in JBoss ?
          rhodan76

          Ok, i managed it now to add the listener via a self created jboss-service, which adds the listener through the JMX RMIAdaptor (see Jboss 4.0 guide, page 69) to the configured Remoting-MBean(s) on server startup.

          But i'm asking myself, if this is the normal way, to add a connection listener in jboss ?

          • 2. Re: How to add ConnectionListener in JBoss ?
            ron_sigal

            You're on the right track. A Connector is an MBean, and once you get a reference to it, you can invoke its methods. You don't need to use the RMIAdaptor, however, since your service is running in the same JVM as the connector. You can talk directly to the MBeanServer.