com.itextpdf.text.log
Class CounterFactory

java.lang.Object
  extended by com.itextpdf.text.log.CounterFactory

public class CounterFactory
extends Object

Factory that creates a counter for every reader or writer class. You can implement your own counter and declare it like this: CounterFactory.getInstance().setCounter(new SysoCounter()); SysoCounter is just an example of a Counter implementation. It writes info about files being read and written to the System.out. This functionality can be used to create metrics in a SaaS context.


Method Summary
 Counter getCounter()
          Getter for the counter.
static Counter getCounter(Class<?> klass)
          Returns a counter factory.
static CounterFactory getInstance()
          Returns the singleton instance of the factory.
 void setCounter(Counter counter)
          Setter for the counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CounterFactory getInstance()
Returns the singleton instance of the factory.


getCounter

public static Counter getCounter(Class<?> klass)
Returns a counter factory.


getCounter

public Counter getCounter()
Getter for the counter.


setCounter

public void setCounter(Counter counter)
Setter for the counter.



Copyright © 2013. All Rights Reserved.