public class DefaultCounterListener extends Object implements CounterListener
DefaultCounterListener is the default implementation of
the CounterListener interface. For any counter incrementation
event it checks whether the referenced counter object already exists. If not,
it will be created and initialized with one. Otherwise, the current value
will be incremented by one. In either case, the current value will be
returned in the event object.
To use a DefaultCounterListener with SNMP4J, add it to the
default CounterSupport by:
CounterSupport.getInstance().addCounterListener(new DefaultCounterListener());
| Constructor and Description |
|---|
DefaultCounterListener()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
incrementCounter(CounterEvent event)
Increment the supplied counter instance and return the current value
(after incrementation) in the event object if the event receiver is the
maintainer of the counter value.
|
public void incrementCounter(CounterEvent event)
CounterListenerincrementCounter in interface CounterListenerevent - a CounterEvent instance.Copyright © 2014 SNMP4J.org. All rights reserved.