public class CounterManager extends Object
ICounterFactory
. Create ICounter
for each registered ICounterFactory
and send corresponding events on document read and write.
ICounterFactory
and register them with register(ICounterFactory)
Or implement ICounter
and register it with SimpleCounterFactory
like this: CounterFactory.getInstance().register(new SimpleCounterFactory(new SystemOutCounter());
SystemOutCounter
is just an example of a ICounter implementation.
This functionality can be used to create metrics in a SaaS context.
Modifier and Type | Method and Description |
---|---|
List<ICounter> |
getCounters(Class> cls)
Returns a list of registered counters for specific class.
|
static CounterManager |
getInstance()
Returns the singleton instance of the factory.
|
void |
register(ICounterFactory factory)
Register new ICounterFactory .
|
boolean |
unregister(ICounterFactory factory)
Unregister specified ICounterFactory .
|
public static CounterManager getInstance()
public List<ICounter> getCounters(Class> cls)
public void register(ICounterFactory factory)
ICounterFactory
. Does nothing if same factory was already registered.
factory
- ICounterFactory
to be registered
public boolean unregister(ICounterFactory factory)
ICounterFactory
. Does nothing if this factory wasn't registered first.
factory
- ICounterFactory
to be unregistered
true
if specified factory was registered first
Copyright © 1998–2018 iText Group NV. All rights reserved.