Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#273 org.jboss.system.ListenerServiceMBeanSupport enhanced

v3.2
closed
nobody
5
2004-03-03
2004-03-03
No

org.jboss.system.ListenerServiceMBeanSupport
baseclass now supports:

a) explicit subscription/unsubscription control
b) the option to not monitor for new MBeans and
perform dynamic notification registrations
c) the option to specify a different MBean as the
receiver of the notifications

Enjoy
Dimitris

/**
* An abstract base class that provides for declarative
JMX notification
* subscription handling.
* <p>
* A JBoss service that is in addition a
NotificationListener can
* subclass ListenerServiceMBeanSupport instead of
ServiceMBeanSupport
* and specify at run-time, inline in the MBean descriptor
using the
* SubscriptionList attribute, the set of
MBeans/notifications the
* service wants to subscribe/receive.
* <p>
* Call subscribe(boolean dynamicSubscriptions) at
anytime to register to
* those MBeans and for those notifications that match
the specified criteria.
* Call unsubscribe() to unsubscribe for Notifications.
* <p>
* If true is passed to subscribe() the baseclass will
monitor for
* registration events from the MBeanServer and
automatically subscribe
* to new instances of MBeans that match the
subscription criteria.
* Monitoring for unsubscribe events in not necessary,
since the MBeanServer
* automatically removes subscriptions to unregistering
MBeans.
* <p>
* An alternative subscribe(boolean
dynamicSubscription, ObjectName listener)
* can be used to specify a different MBean as the
receiver of the
* subscribed notifications. The specified MBean must be
a NotificationListener.
* <p>
* To handle the incoming notifications override the
handleNotification2()
* method. The usual handleNotification() method should
not be overriden,
* since it is used to monitor the incoming notifications
for registration
* events coming from the MBeanServer, before
delegating to
* handleNotification2(), in order to implement dynamic
subscriptions.
*
* @see ListenerServiceMBean
*
* REVISIONS
* =========
* 28/02/04, Dimitris Andreadis
*
* explicit subscribe()/unsubscribe() replaced implicit
start()/stop();
* dynamic subscription behaviour can be
enabled/disabled, plus it is
* now possible to specify an external MBean as
notification listener.

Discussion

    • status: open --> closed