This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.management
class StandardEmitterMBean

java.lang.Object extended by javax.management.StandardMBean extended by javax.management.StandardEmitterMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationEmitter

public class StandardEmitterMBean
extends StandardMBean
implements 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 {@link #StandardEmitterMBean(Object, Class, NotificationEmitter) 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 {@link NotificationEmitter}. The example uses the class {@link NotificationBroadcasterSupport} as an implementation of 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);
     


Constructor Summary
protected
StandardEmitterMBean(Class mbeanInterface, boolean isMXBean, NotificationEmitter emitter)

          Make an MBean whose management interface is specified by , and where notifications are handled by the given .
protected

          Make an MBean whose management interface is specified by , and where notifications are handled by the given .
 
StandardEmitterMBean(Object implementation, Class mbeanInterface, boolean isMXBean, NotificationEmitter emitter)

          Make an MBean whose management interface is specified by , with the given implementation and where notifications are handled by the given .
 
StandardEmitterMBean(Object implementation, Class mbeanInterface, NotificationEmitter emitter)

          Make an MBean whose management interface is specified by , with the given implementation and where notifications are handled by the given .
 
Method Summary
 void

          
 MBeanNotificationInfo[]

          
 void

          
 void

          
 void

          Sends a notification.
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardEmitterMBean

protected StandardEmitterMBean(Class mbeanInterface,
                               boolean isMXBean,
                               NotificationEmitter emitter)

Make an MBean whose management interface is specified by {@code mbeanInterface}, and where notifications are handled by the given {@code NotificationEmitter}. This constructor can be used to make either Standard MBeans or MXBeans. The resultant MBean implements the {@code NotificationEmitter} interface by forwarding its methods to {@code emitter}.

If {@code emitter} is an instance of {@code NotificationBroadcasterSupport} then the MBean's {@link #sendNotification sendNotification} method will call {@code emitter.}{@link NotificationBroadcasterSupport#sendNotification sendNotification}.

The array returned by {@link #getNotificationInfo()} on the new MBean is a copy of the array returned by {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo getNotificationInfo()} at the time of construction. If the array returned by {@code emitter.getNotificationInfo()} later changes, that will have no effect on this object's {@code getNotificationInfo()}.

This constructor must be called from a subclass that implements the given {@code mbeanInterface}.

Parameters:
mbeanInterface - a StandardMBean interface.
isMXBean - If true, the {@code mbeanInterface} parameter names an MXBean interface and the resultant MBean is an MXBean.
emitter - the object that will handle notifications.

StandardEmitterMBean

protected StandardEmitterMBean(Class mbeanInterface,
                               NotificationEmitter emitter)

Make an MBean whose management interface is specified by {@code mbeanInterface}, and where notifications are handled by the given {@code NotificationEmitter}. The resultant MBean implements the {@code NotificationEmitter} interface by forwarding its methods to {@code emitter}.

If {@code emitter} is an instance of {@code NotificationBroadcasterSupport} then the MBean's {@link #sendNotification sendNotification} method will call {@code emitter.}{@link NotificationBroadcasterSupport#sendNotification sendNotification}.

The array returned by {@link #getNotificationInfo()} on the new MBean is a copy of the array returned by {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo getNotificationInfo()} at the time of construction. If the array returned by {@code emitter.getNotificationInfo()} later changes, that will have no effect on this object's {@code getNotificationInfo()}.

This constructor must be called from a subclass that implements the given {@code mbeanInterface}.

Parameters:
mbeanInterface - a StandardMBean interface.
emitter - the object that will handle notifications.

StandardEmitterMBean

public StandardEmitterMBean(Object implementation,
                            Class mbeanInterface,
                            boolean isMXBean,
                            NotificationEmitter emitter)

Make an MBean whose management interface is specified by {@code mbeanInterface}, with the given implementation and where notifications are handled by the given {@code NotificationEmitter}. This constructor can be used to make either Standard MBeans or MXBeans. The resultant MBean implements the {@code NotificationEmitter} interface by forwarding its methods to {@code emitter}. It is legal and useful for {@code implementation} and {@code emitter} to be the same object.

If {@code emitter} is an instance of {@code NotificationBroadcasterSupport} then the MBean's {@link #sendNotification sendNotification} method will call {@code emitter.}{@link NotificationBroadcasterSupport#sendNotification sendNotification}.

The array returned by {@link #getNotificationInfo()} on the new MBean is a copy of the array returned by {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo getNotificationInfo()} at the time of construction. If the array returned by {@code emitter.getNotificationInfo()} later changes, that will have no effect on this object's {@code getNotificationInfo()}.

Parameters:
implementation - the implementation of the MBean interface.
mbeanInterface - a Standard MBean interface.
isMXBean - If true, the {@code mbeanInterface} parameter names an MXBean interface and the resultant MBean is an MXBean.
emitter - the object that will handle notifications.

StandardEmitterMBean

public StandardEmitterMBean(Object implementation,
                            Class mbeanInterface,
                            NotificationEmitter emitter)

Make an MBean whose management interface is specified by {@code mbeanInterface}, with the given implementation and where notifications are handled by the given {@code NotificationEmitter}. The resultant MBean implements the {@code NotificationEmitter} interface by forwarding its methods to {@code emitter}. It is legal and useful for {@code implementation} and {@code emitter} to be the same object.

If {@code emitter} is an instance of {@code NotificationBroadcasterSupport} then the MBean's {@link #sendNotification sendNotification} method will call {@code emitter.}{@link NotificationBroadcasterSupport#sendNotification sendNotification}.

The array returned by {@link #getNotificationInfo()} on the new MBean is a copy of the array returned by {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo getNotificationInfo()} at the time of construction. If the array returned by {@code emitter.getNotificationInfo()} later changes, that will have no effect on this object's {@code getNotificationInfo()}.

Parameters:
implementation - the implementation of the MBean interface.
mbeanInterface - a Standard MBean interface.
emitter - the object that will handle notifications.
Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Parameters:
listener
filter
handback

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Parameters:
listener
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Parameters:
listener
filter
handback
Throws:
ListenerNotFoundException

sendNotification

public void sendNotification(Notification n)

Sends a notification.

If the {@code emitter} parameter to the constructor was an instance of {@code NotificationBroadcasterSupport} then this method will call {@code emitter.}{@link NotificationBroadcasterSupport#sendNotification sendNotification}.

Parameters:
n - the notification to send.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.