cz.cuni.amis.pogamut.base.utils.jmx.flag
Class JMXFlagDecorator<T extends Serializable>
java.lang.Object
cz.cuni.amis.pogamut.base.utils.jmx.flag.JMXFlagDecorator<T>
- All Implemented Interfaces:
- JMXFlagDecoratorMBean, NotificationBroadcaster, NotificationEmitter
public class JMXFlagDecorator<T extends Serializable>
- extends Object
- implements JMXFlagDecoratorMBean, NotificationEmitter
Translates Flag events to JMX events. Adds a listener on the flag and resends
the events to supplied broadcaster support.
- Author:
- Ik
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
flag
protected cz.cuni.amis.utils.flag.Flag<T extends Serializable> flag
source
protected ObjectName source
eventCounter
protected int eventCounter
flagName
protected String flagName
listener
protected cz.cuni.amis.utils.flag.FlagListener<T extends Serializable> listener
nbs
protected NotificationBroadcasterSupport nbs
- Support object for sending notifications.
JMXFlagDecorator
public JMXFlagDecorator(cz.cuni.amis.utils.flag.Flag<T> flag,
ObjectName source,
MBeanServer mbs,
String flagName)
throws MalformedObjectNameException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException
- Parameters:
flag
- Flag to be exposed through JMX.source
- MBean or ObjectName of the object where the flag resides.nbs
- NotificationBroadcasterSupport through which the events will be send.
- Throws:
MalformedObjectNameException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
stop
public void stop()
- Stops listening for the flag events.
getMBeanNotificationInfo
public MBeanNotificationInfo getMBeanNotificationInfo()
- Returns:
- Notification info about this events possibly raised by this flag.
getFlag
public Serializable getFlag()
- Specified by:
getFlag
in interface JMXFlagDecoratorMBean
- Returns:
- Current flag value.
removeNotificationListener
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface NotificationEmitter
- Throws:
ListenerNotFoundException
addNotificationListener
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
- Specified by:
addNotificationListener
in interface NotificationBroadcaster
- Throws:
IllegalArgumentException
removeNotificationListener
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface NotificationBroadcaster
- Throws:
ListenerNotFoundException
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfo
in interface NotificationBroadcaster
Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.