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 {@link #StandardEmitterMBean(Object,Class,NotificationEmitter) StandardEmitterMBean(implementation, mbeanInterface, emitter)} tocreate 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 {@link NotificationEmitter}. The example uses the class {@link NotificationBroadcasterSupport} as an implementationof the interface {@link 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);
@see StandardMBean
@since 1.6