Class DynamicMBeanProxy
- All Implemented Interfaces:
DynamicMBean
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 Summary
Modifier and TypeMethodDescriptionstatic DynamicMBeanProxynewDynamicMBeanProxy(MBeanServerConnection connection, ObjectName objectName) This static factory ensures that instances produced implementNotificationBroadcasterandNotificationEmitterinterfaces where appropriate.static DynamicMBeanProxynewDynamicMBeanProxy(MBeanServerConnection connection, ObjectName objectName, boolean ignoreInstanceNotFound) Same as the other variation of newDynamicMBeanProxy() except that the caller can choose not to ignore InstanceNotFoundException's.
-
Method Details
-
newDynamicMBeanProxy
public static DynamicMBeanProxy newDynamicMBeanProxy(MBeanServerConnection connection, ObjectName objectName) This static factory ensures that instances produced implementNotificationBroadcasterandNotificationEmitterinterfaces where appropriate. This is necessary for proper operation of notification listener registration, etc.This factory simply creates instances of
DynamicBroadcasterProxyandDynamicEmitterProxyin 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
-