Class MBeanListener<T extends MBeanListener.Callback>

    • Constructor Detail

      • MBeanListener

        public MBeanListener​(MBeanServerConnection server,
                             String domain,
                             String type,
                             T callback)
        Listener for all MBeans of specified type, with or without a name. Caller must call startListening() to start listening.
        Parameters:
        server -
        type - type of the MBean (as found in the ObjectName)
        callback -
      • MBeanListener

        public MBeanListener​(MBeanServerConnection server,
                             String domain,
                             String type,
                             String name,
                             T callback)
        Listener for MBeans of specified type, with specified name (or any name if null is passed for the name). Caller must call startListening() to start listening.
        Parameters:
        server -
        type - type of the MBean (as found in the ObjectName)
        name - name of the MBean, or null if none
        callback -
    • Method Detail

      • getType

        public String getType()
      • getName

        public String getName()
      • getCallback

        public T getCallback()
      • startListening

        public void startListening()
        Start listening. If the required MBean(s) are already present, the callback will be synchronously made before returning. It is also possible that the callback could happen twice for the same MBean.
      • stopListening

        public void stopListening()
        unregister the listener