3 Replies Latest reply on Sep 5, 2002 10:20 AM by juha

    MBeanServerDelegate question

      I am trying to call removeNotificationListener on the MBeanServerDelegate object that is registered in the default MBeanServer.

      My question is how do I do this?
      I can't invoke it since removeNotificationListener is not available in the managment operations.

      I tried creating an MBeanServerDelegate object but it does not return the same getMBeanServerId as the one in the jmx-console.

      I am using JBoss 2.4.4

        • 1. Re: MBeanServerDelegate question

          MBeanServer.removeNotificationListener()

          • 2. Re: MBeanServerDelegate question

            This is what I eneded up using, however, since the MBeanServerDelegate version of the same method just required the listener object to be passed I wanted to it instead. No big deal.

            • 3. Re: MBeanServerDelegate question

              that won't work since when you register your listener to an MBean, the server generates its own listener object that is the one actually passed to the MBean.

              (that's how I remember the code anyway, might have changed)

              Which is an interesting point in a way, we end up breaking the direct manipulation of the object because the client can't know the actual listener object.

              At least when you're doing a combo of registering thru server and trying to unregister directly.

              Registering directly and then unregistering directly on the object should work (of course you should not be able to get a direct ref to the delegate object in the first place, so I guess this whole point is moot).

              rambling..