org.ow2.jonas.lib.reconfig
Class ReconfigEmitter

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter
Direct Known Subclasses:
AbsServiceImpl, AbstractJResource

public class ReconfigEmitter
extends NotificationBroadcasterSupport

This class is to be extended by classes which need to send reconfiguration JMX notifications. It extends NotificationBroadcasterSupport which provides addNotificationListener implementation. Listeners are MBeans interested by handling the reconfiguration notifications emitted by the sub-classes instances. This class replaces ReconfigDispatcher class.

Author:
Adriana Danes

Field Summary
static String RECONFIG_TYPE
          Management notification type for reconfiguration events (notify that the management application made a reconfiguration operation)
static String SAVE_RECONFIG_TYPE
          Management notification type for save configuration events (notify that the management application asks for save changes)
 
Constructor Summary
ReconfigEmitter()
           
 
Method Summary
 void initLogger(org.objectweb.util.monolog.api.Logger mylogger)
          Initialize the logger with a Logger provided by the reconfigurable resource or service.
 void sendReconfigNotification(long sequenceNumber, String resourceName, Object userData)
          Send a reconfiguration notification to the registerd listener.
 void sendSaveNotification(long sequenceNumber, String resourceName)
          Send a save configuration notification to the registerd listeners.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECONFIG_TYPE

public static final String RECONFIG_TYPE
Management notification type for reconfiguration events (notify that the management application made a reconfiguration operation)

See Also:
Constant Field Values

SAVE_RECONFIG_TYPE

public static final String SAVE_RECONFIG_TYPE
Management notification type for save configuration events (notify that the management application asks for save changes)

See Also:
Constant Field Values
Constructor Detail

ReconfigEmitter

public ReconfigEmitter()
Method Detail

initLogger

public void initLogger(org.objectweb.util.monolog.api.Logger mylogger)
Initialize the logger with a Logger provided by the reconfigurable resource or service.

Parameters:
mylogger - the logger provided by a sub-class

sendSaveNotification

public void sendSaveNotification(long sequenceNumber,
                                 String resourceName)
Send a save configuration notification to the registerd listeners.

Parameters:
sequenceNumber - notification attribute
resourceName - the name of a reconfigurable resource or of a JOnAS service

sendReconfigNotification

public void sendReconfigNotification(long sequenceNumber,
                                     String resourceName,
                                     Object userData)
Send a reconfiguration notification to the registerd listener.

Parameters:
sequenceNumber - notification attribute
resourceName - the name of a reconfigurable resource or of a JOnAS service
userData - data containing the name and the value of the reconfigured property(or properties)


Copyright © 2010 OW2 Consortium. All Rights Reserved.