Top Description Fields Constructors Methods
org.glassfish.pfl.tf.timer.spi

public Class TimerManager<T>

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, org.glassfish.pfl.tf.spi.MethodMonitorRegistry

Provides access to timer facilities. This is intended to make it easy to set up timing, either for performance tests, or for adaptive policy management. Note that the constructor and the initialize method must be called from the same thread in order to safely complete the initialization of an instance of this class. After that, multiple threads may access this class for the factory(), points(), and controller() methods.

Field Summary

Modifier and TypeField and Description
private final Map<Class<?>, List<Timer>>
private final TimerEventController
private volatile boolean
private final TimerFactory
private volatile T

Constructor Summary

AccessConstructor and Description
public
TimerManager(ObjectRegistrationManager orm, String name)

Create a new TimerManager, with a TimerFactory registered under the given name in the TimerFactoryBuilder, and a TimerEventController with the same name.

public

Method Summary

Modifier and TypeMethod and Description
private void
public TimerEventController
controller()

Return a TimerController.

public void
destroy()

Destroy this TimerManager by removing its TimerFactory from the TimerFactoryBuilder.

public TimerFactory
factory()

Get the TimerFactory.

public synchronized List<Timer>
getTimers(Class<?> cls)

public void
initialize(T tp)

public T
points()

Get the timing point utility class of type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classToTimersback to summary
private final Map<Class<?>, List<Timer>> classToTimers
controllerback to summary
private final TimerEventController controller
isInitializedback to summary
private volatile boolean isInitialized
tfback to summary
private final TimerFactory tf
tpback to summary
private volatile T tp

Constructor Detail

TimerManagerback to summary
public TimerManager(ObjectRegistrationManager orm, String name)

Create a new TimerManager, with a TimerFactory registered under the given name in the TimerFactoryBuilder, and a TimerEventController with the same name.

TimerManagerback to summary
public TimerManager(String name)

Method Detail

checkInitializedback to summary
private void checkInitialized()
controllerback to summary
public TimerEventController controller()

Return a TimerController. Returns null if called before initialize( T ).

destroyback to summary
public void destroy()

Destroy this TimerManager by removing its TimerFactory from the TimerFactoryBuilder.

factoryback to summary
public TimerFactory factory()

Get the TimerFactory.

getTimersback to summary
public synchronized List<Timer> getTimers(Class<?> cls)
initializeback to summary
public void initialize(T tp)
pointsback to summary
public T points()

Get the timing point utility class of type T.