org.apache.commons.monitoring.listeners
Class SecondaryMonitor
java.lang.Object
org.apache.commons.monitoring.impl.monitors.AbstractMonitor
org.apache.commons.monitoring.listeners.SecondaryMonitor
- All Implemented Interfaces:
- Detachable, Monitor, Monitor.Listener
public class SecondaryMonitor
- extends AbstractMonitor
- implements Monitor.Listener, Detachable
A Monitor implementation that maintains a set of secondary StatValues in sync
with the primary monitor. Register itself as a monitor listener to get notified
on new StatValues and automatically create the required secondary.
When detached, deregister itself as Monitor.Listener and detaches all secondary
from the primary StatValues.
- Author:
- Nicolas De Loof
| Methods inherited from class org.apache.commons.monitoring.impl.monitors.AbstractMonitor |
getCounter, getCounter, getGauge, getGauge, getKey, getRoles, getValue, getValue, getValues, register, reset |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecondaryMonitor
public SecondaryMonitor(Monitor.Observable monitor)
detach
public void detach()
- Description copied from interface:
Detachable
- Detach the instance from live monitoring beackbone. Any new monitoring
event will not affect datas in this component.
- Specified by:
detach in interface Detachable
onStatValueRegistered
public void onStatValueRegistered(StatValue value)
- Specified by:
onStatValueRegistered in interface Monitor.Listener
isDetached
public boolean isDetached()
- Specified by:
isDetached in interface Detachable
getAttachedAt
public long getAttachedAt()
- Specified by:
getAttachedAt in interface Detachable
getDetachedAt
public long getDetachedAt()
- Specified by:
getDetachedAt in interface Detachable
Copyright © 2008 The Apache Software Foundation. All Rights Reserved.