Class StandardEmitterMBean
java.lang.Object
javax.management.StandardMBean
javax.management.StandardEmitterMBean
- All Implemented Interfaces:
DynamicMBean
,MBeanRegistration
,NotificationBroadcaster
,NotificationEmitter
An MBean whose management interface is determined by reflection on a Java interface, and that emits notifications.
The following example shows how to use the public constructor
StandardEmitterMBean(implementation, mbeanInterface, emitter)
to
create an MBean emitting notifications with any
implementation class name Impl, with a management
interface defined (as for current Standard MBeans) by any interface
Intf, and with any implementation of the interface
NotificationEmitter
. The example uses the class
NotificationBroadcasterSupport
as an implementation
of the interface NotificationEmitter
.
MBeanServer mbs; ... final String[] types = new String[] {"sun.disc.space","sun.disc.alarm"}; final MBeanNotificationInfo info = new MBeanNotificationInfo( types, Notification.class.getName(), "Notification about disc info."); final NotificationEmitter emitter = new NotificationBroadcasterSupport(info); final Intf impl = new Impl(...); final Object mbean = new StandardEmitterMBean( impl, Intf.class, emitter); mbs.registerMBean(mbean, objectName);
- Since:
- 1.6
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StandardEmitterMBean
(Class<?> mbeanInterface, boolean isMXBean, NotificationEmitter emitter) Make an MBean whose management interface is specified bymbeanInterface
, and where notifications are handled by the givenNotificationEmitter
.protected
StandardEmitterMBean
(Class<?> mbeanInterface, NotificationEmitter emitter) Make an MBean whose management interface is specified bymbeanInterface
, and where notifications are handled by the givenNotificationEmitter
.<T>
StandardEmitterMBean
(T implementation, Class<T> mbeanInterface, boolean isMXBean, NotificationEmitter emitter) Make an MBean whose management interface is specified bymbeanInterface
, with the given implementation and where notifications are handled by the givenNotificationEmitter
.<T>
StandardEmitterMBean
(T implementation, Class<T> mbeanInterface, NotificationEmitter emitter) Make an MBean whose management interface is specified bymbeanInterface
, with the given implementation and where notifications are handled by the givenNotificationEmitter
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Adds a listener to this MBean.Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.void
Removes a listener from this MBean.void