|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
javax.management
|
Constructor Summary | |
---|---|
protected |
StandardEmitterMBean(Class<?> mbeanInterface,
boolean isMXBean,
NotificationEmitter emitter)
Make an MBean whose management interface is specified by mbeanInterface , and where notifications are handled by
the given NotificationEmitter . |
protected |
StandardEmitterMBean(Class<?> mbeanInterface,
NotificationEmitter emitter)
Make an MBean whose management interface is specified by mbeanInterface , and
where notifications are handled by the given NotificationEmitter . |
|
StandardEmitterMBean(T implementation,
Class<T> mbeanInterface,
boolean isMXBean,
NotificationEmitter emitter)
Make an MBean whose management interface is specified by mbeanInterface , with the given implementation and where
notifications are handled by the given NotificationEmitter . |
|
StandardEmitterMBean(T implementation,
Class<T> mbeanInterface,
NotificationEmitter emitter)
Make an MBean whose management interface is specified by mbeanInterface , with the given implementation and
where notifications are handled by the given NotificationEmitter . |
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Adds a listener to this MBean. |
MBeanNotificationInfo[] |
getNotificationInfo()
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 |
removeNotificationListener(NotificationListener listener)
Removes a listener from this MBean. |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes a listener from this MBean. |
void |
sendNotification(Notification n)
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 |
---|
public StandardEmitterMBean(T implementation, Class<T> mbeanInterface, NotificationEmitter emitter)
Make an MBean whose management interface is specified by
mbeanInterface
, with the given implementation and
where notifications are handled by the given NotificationEmitter
.
The resultant MBean implements the NotificationEmitter
interface
by forwarding its methods to emitter
. It is legal and useful
for implementation
and emitter
to be the same object.
If emitter
is an instance of NotificationBroadcasterSupport
then the MBean's sendNotification
method will call emitter.
sendNotification
.
The array returned by getNotificationInfo()
on the
new MBean is a copy of the array returned by
emitter.
getNotificationInfo()
at the time of construction. If the array
returned by emitter.getNotificationInfo()
later changes,
that will have no effect on this object's
getNotificationInfo()
.
implementation
- the implementation of the MBean interface.mbeanInterface
- a Standard MBean interface.emitter
- the object that will handle notifications.
IllegalArgumentException
- if the mbeanInterface
does not follow JMX design patterns for Management Interfaces, or
if the given implementation
does not implement the
specified interface, or if emitter
is null.public StandardEmitterMBean(T implementation, Class<T> mbeanInterface, boolean isMXBean, NotificationEmitter emitter)
Make an MBean whose management interface is specified by
mbeanInterface
, with the given implementation and where
notifications are handled by the given NotificationEmitter
. This constructor can be used to make
either Standard MBeans or MXBeans. The resultant MBean
implements the NotificationEmitter
interface by
forwarding its methods to emitter
. It is legal and
useful for implementation
and emitter
to be the
same object.
If emitter
is an instance of NotificationBroadcasterSupport
then the MBean's sendNotification
method will call emitter.
sendNotification
.
The array returned by getNotificationInfo()
on the
new MBean is a copy of the array returned by
emitter.
getNotificationInfo()
at the time of construction. If the array
returned by emitter.getNotificationInfo()
later changes,
that will have no effect on this object's
getNotificationInfo()
.
implementation
- the implementation of the MBean interface.mbeanInterface
- a Standard MBean interface.isMXBean
- If true, the mbeanInterface
parameter
names an MXBean interface and the resultant MBean is an MXBean.emitter
- the object that will handle notifications.
IllegalArgumentException
- if the mbeanInterface
does not follow JMX design patterns for Management Interfaces, or
if the given implementation
does not implement the
specified interface, or if emitter
is null.protected StandardEmitterMBean(Class<?> mbeanInterface, NotificationEmitter emitter)
Make an MBean whose management interface is specified by
mbeanInterface
, and
where notifications are handled by the given NotificationEmitter
.
The resultant MBean implements the NotificationEmitter
interface
by forwarding its methods to emitter
.
If emitter
is an instance of NotificationBroadcasterSupport
then the MBean's sendNotification
method will call emitter.
sendNotification
.
The array returned by getNotificationInfo()
on the
new MBean is a copy of the array returned by
emitter.
getNotificationInfo()
at the time of construction. If the array
returned by emitter.getNotificationInfo()
later changes,
that will have no effect on this object's
getNotificationInfo()
.
This constructor must be called from a subclass that implements
the given mbeanInterface
.
mbeanInterface
- a StandardMBean interface.emitter
- the object that will handle notifications.
IllegalArgumentException
- if the mbeanInterface
does not follow JMX design patterns for Management Interfaces, or
if this
does not implement the specified interface, or
if emitter
is null.protected StandardEmitterMBean(Class<?> mbeanInterface, boolean isMXBean, NotificationEmitter emitter)
Make an MBean whose management interface is specified by
mbeanInterface
, and where notifications are handled by
the given NotificationEmitter
. This constructor can be
used to make either Standard MBeans or MXBeans. The resultant
MBean implements the NotificationEmitter
interface by
forwarding its methods to emitter
.
If emitter
is an instance of NotificationBroadcasterSupport
then the MBean's sendNotification
method will call emitter.
sendNotification
.
The array returned by getNotificationInfo()
on the
new MBean is a copy of the array returned by
emitter.
getNotificationInfo()
at the time of construction. If the array
returned by emitter.getNotificationInfo()
later changes,
that will have no effect on this object's
getNotificationInfo()
.
This constructor must be called from a subclass that implements
the given mbeanInterface
.
mbeanInterface
- a StandardMBean interface.isMXBean
- If true, the mbeanInterface
parameter
names an MXBean interface and the resultant MBean is an MXBean.emitter
- the object that will handle notifications.
IllegalArgumentException
- if the mbeanInterface
does not follow JMX design patterns for Management Interfaces, or
if this
does not implement the specified interface, or
if emitter
is null.Method Detail |
---|
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener
in interface NotificationBroadcaster
listener
- A listener that was previously added to this
MBean.
ListenerNotFoundException
- The listener is not
registered with the MBean.NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
,
NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
NotificationEmitter
Removes a listener from this MBean. The MBean must have a
listener that exactly matches the given listener
,
filter
, and handback
parameters. If
there is more than one such listener, only one is removed.
The filter
and handback
parameters
may be null if and only if they are null in a listener to be
removed.
removeNotificationListener
in interface NotificationEmitter
listener
- A listener that was previously added to this
MBean.filter
- The filter that was specified when the listener
was added.handback
- The handback that was specified when the listener was
added.
ListenerNotFoundException
- The listener is not
registered with the MBean, or it is not registered with the
given filter and handback.public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
listener
- The listener object which will handle the
notifications emitted by the broadcaster.filter
- The filter object. If filter is null, no
filtering will be performed before handling notifications.handback
- An opaque object to be sent back to the
listener when a notification is emitted. This object cannot be
used by the Notification broadcaster object. It should be
resent unchanged with the notification to the listener.NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)
public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.
getNotificationInfo
in interface NotificationBroadcaster
public void sendNotification(Notification n)
Sends a notification.
If the emitter
parameter to the constructor was an
instance of NotificationBroadcasterSupport
then this
method will call emitter.
sendNotification
.
n
- the notification to send.
ClassCastException
- if the emitter
parameter to the
constructor was not a NotificationBroadcasterSupport
.