Package wt.jmx.core

Class DynamicMBeanProxy

java.lang.Object
wt.jmx.core.DynamicMBeanProxy
All Implemented Interfaces:
DynamicMBean

public class DynamicMBeanProxy extends Object implements DynamicMBean
This class implements the DynamicMBean interface against an MBeanServerConnection and ObjectName by translating DynamicMBean method calls into appropriate MBeanServerConnection method calls using the appropriate ObjectName.

Unlike proxy objects produced by MBeanServerInvocationHandler instances of this class do not require knowledge of any interfaces the originating MBean implements. As a result, instances of this class do not implement such interfaces, however, with the exception of NotificationBroadcaster and NotificationEmitter where appropriate. Also, instances of this class are themselves MBeans whereas those produced by MBeanServerInvocationHandler are just proxies for a given interface of the target object.

Supported API: true

Extendable: false

  • Method Details

    • newDynamicMBeanProxy

      public static DynamicMBeanProxy newDynamicMBeanProxy(MBeanServerConnection connection, ObjectName objectName)
      This static factory ensures that instances produced implement NotificationBroadcaster and NotificationEmitter interfaces where appropriate. This is necessary for proper operation of notification listener registration, etc.

      This factory simply creates instances of DynamicBroadcasterProxy and DynamicEmitterProxy in these cases (respectively).

      Note this method returns an MBean in any event -- even if the target MBean no longer exists. To receive an InstanceNotFoundException instead in a case see the other variation of this method.

      Supported API: true

    • newDynamicMBeanProxy

      public static DynamicMBeanProxy newDynamicMBeanProxy(MBeanServerConnection connection, ObjectName objectName, boolean ignoreInstanceNotFound) throws InstanceNotFoundException
      Same as the other variation of newDynamicMBeanProxy() except that the caller can choose not to ignore InstanceNotFoundException's.

      Supported API: true
      Throws:
      InstanceNotFoundException