Top Inners Fields Constructors Methods
org.glassfish.pfl.tf.timer.impl

public Class TimerFactoryImpl

extends TimerGroupImpl
implements TimerFactory
Class Inheritance
All Implemented Interfaces
org.glassfish.pfl.tf.timer.spi.TimerFactory, org.glassfish.pfl.tf.timer.spi.TimerGroup, org.glassfish.pfl.tf.timer.spi.Controllable, org.glassfish.pfl.tf.timer.spi.Named
Imports
java.util.Collections, .HashMap, .HashSet, .LinkedHashMap, .Map, .Set, org.glassfish.pfl.tf.timer.spi.Controllable, .LogEventHandler, .NamedBase, .ObjectRegistrationManager, .StatsEventHandler, .Timer, .TimerEvent, .TimerEventController, .TimerEventControllerBase, .TimerEventHandler, .TimerFactory, .TimerGroup

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private Map<Controllable, Integer>
private Map<Integer, Controllable>
private int
private ObjectRegistrationManager
private Map<String, TimerGroupImpl>
private Map<String, TimerImpl>
private Map<String, TimerEventControllerBase>
private Map<String, TimerEventHandler>
private Map<String, TimerGroupImpl>
private Map<String, TimerImpl>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized Set<Timer>
activeSet()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.activeSet.

Returns a read-only view of the set of Controllables that are currently active.

private void
checkArgs(Set<String> inUse, String name, String description)

public synchronized Set<? extends Controllable>
enabledSet()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.enabledSet.

Returns a read-only view of the set of enabled Controllables.

public synchronized Controllable
getControllable(int id)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.getControllable.

Returns the Controllable corresponding to id, for id in the range 0 (inclusive) to numberOfIds() (exclusive).

public synchronized TimerEventController
makeController(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeController.

Create a TimerController, which can create TimerEvents and send them to registered TimerEventHandlers.

public synchronized LogEventHandler
public synchronized StatsEventHandler
public synchronized StatsEventHandler
public synchronized Timer
makeTimer(String name, String description)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimer.

Create a new Timer.

public synchronized TimerGroup
makeTimerGroup(String name, String description)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimerGroup.

Create a new TimerGroup.

public synchronized TimerEventHandler
private void
public synchronized int
numberOfIds()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.numberOfIds.

Returns the maximum id used by this TimerFactory for creating Controllables.

public synchronized void
removeController(TimerEventControllerBase controller)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.removeController.

Remove the controller from this factory.

public synchronized void
public void
public synchronized boolean
timerAlreadyExists(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timerAlreadyExists.

Return true iff a timer with the given name already exists.

public synchronized Map<String, TimerGroupImpl>
timerGroups()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timerGroups.

Returns a read-only map from TimerGroup names to TimerGroups.

public synchronized Map<String, TimerImpl>
timers()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timers.

Returns a read-only map from Timer names to Timers.

pack-priv void
Inherited from org.glassfish.pfl.tf.timer.impl.TimerGroupImpl:
addcontentsremovetcContents

Field Detail

conToIntback to summary
private Map<Controllable, Integer> conToInt
intToConback to summary
private Map<Integer, Controllable> intToCon
nextIndexback to summary
private int nextIndex
ormback to summary
private ObjectRegistrationManager orm
roTimerGroupsback to summary
private Map<String, TimerGroupImpl> roTimerGroups
roTimersback to summary
private Map<String, TimerImpl> roTimers
timerEventControllersback to summary
private Map<String, TimerEventControllerBase> timerEventControllers
timerEventHandlersback to summary
private Map<String, TimerEventHandler> timerEventHandlers
timerGroupsback to summary
private Map<String, TimerGroupImpl> timerGroups
timersback to summary
private Map<String, TimerImpl> timers

Constructor Detail

TimerFactoryImplback to summary
public TimerFactoryImpl(ObjectRegistrationManager orm, String name, String description)

Method Detail

activeSetback to summary
public synchronized Set<Timer> activeSet()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.activeSet.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.activeSet.

Returns a read-only view of the set of Controllables that are currently active. An enabled Timer is active. All Controllables contained in an active or enabled TimerGroup are active.

Annotations
@Override
checkArgsback to summary
private void checkArgs(Set<String> inUse, String name, String description)
enabledSetback to summary
public synchronized Set<? extends Controllable> enabledSet()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.enabledSet.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.enabledSet.

Returns a read-only view of the set of enabled Controllables. These have been explicitly enabled via a call to enable().

Annotations
@Override
getControllableback to summary
public synchronized Controllable getControllable(int id)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.getControllable.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.getControllable.

Returns the Controllable corresponding to id, for id in the range 0 (inclusive) to numberOfIds() (exclusive).

Annotations
@Override
makeControllerback to summary
public synchronized TimerEventController makeController(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeController.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeController.

Create a TimerController, which can create TimerEvents and send them to registered TimerEventHandlers.

Annotations
@Override
makeLogEventHandlerback to summary
public synchronized LogEventHandler makeLogEventHandler(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeLogEventHandler.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeLogEventHandler.

Create a new LogEventHandler. All LogEventHandler names must be unique within the same TimerFactory.

Annotations
@Override
makeMultiThreadedStatsEventHandlerback to summary
public synchronized StatsEventHandler makeMultiThreadedStatsEventHandler(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeMultiThreadedStatsEventHandler.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeMultiThreadedStatsEventHandler.

Create a new StatsEventHandler. A StatsEventHandler records running statistics for all enter/exit pairs until it is cleared, at which point it starts over. It will keep data separated for each thread, combining information correctly from multiple threads. All StatsEventHandler names must be unique within the same TimerFactory. This StatsEventHandler is multi-thread safe.

Annotations
@Override
makeStatsEventHandlerback to summary
public synchronized StatsEventHandler makeStatsEventHandler(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeStatsEventHandler.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeStatsEventHandler.

Create a new StatsEventHandler. A StatsEventHandler records running statistics for all enter/exit pairs until it is cleared, at which point it starts over. It will keep data separated for each thread, combining information correctly from multiple threads. All StatsEventHandler names must be unique within the same TimerFactory. This StatsEventHandler must be used from a single thread.

Annotations
@Override
makeTimerback to summary
public synchronized Timer makeTimer(String name, String description)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimer.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimer.

Create a new Timer. Note that Timers cannot be destroyed, other than by garbage collecting the TimerFactory that created them.

Annotations
@Override
makeTimerGroupback to summary
public synchronized TimerGroup makeTimerGroup(String name, String description)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimerGroup.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTimerGroup.

Create a new TimerGroup. Note that TimerGroups cannot be destroyed, other than by garbage collecting the TimerFactory that created them.

Annotations
@Override
makeTracingEventHandlerback to summary
public synchronized TimerEventHandler makeTracingEventHandler(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.makeTracingEventHandler.

Annotations
@Override
mapIdback to summary
private void mapId(Controllable con)
numberOfIdsback to summary
public synchronized int numberOfIds()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.numberOfIds.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.numberOfIds.

Returns the maximum id used by this TimerFactory for creating Controllables. The value of con.id() for any Controllable created by this TimerFactory always ranges from 0 inclusive to numberOfIds() exclusive.

Annotations
@Override
removeControllerback to summary
public synchronized void removeController(TimerEventControllerBase controller)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.removeController.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.removeController.

Remove the controller from this factory. The controller should not be used after this call.

Annotations
@Override
removeTimerEventHandlerback to summary
public synchronized void removeTimerEventHandler(TimerEventHandler handler)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.removeTimerEventHandler.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.removeTimerEventHandler.

Remove the handler from this TimerFactory. The handler should not be used after this call.

Annotations
@Override
saveTimerEventControllerback to summary
public void saveTimerEventController(TimerEventControllerBase tec)
timerAlreadyExistsback to summary
public synchronized boolean timerAlreadyExists(String name)

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timerAlreadyExists.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.timerAlreadyExists.

Return true iff a timer with the given name already exists.

Annotations
@Override
timerGroupsback to summary
public synchronized Map<String, TimerGroupImpl> timerGroups()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timerGroups.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.timerGroups.

Returns a read-only map from TimerGroup names to TimerGroups.

Annotations
@Override
timersback to summary
public synchronized Map<String, TimerImpl> timers()

Implements org.glassfish.pfl.tf.timer.spi.TimerFactory.timers.

Doc from org.glassfish.pfl.tf.timer.spi.TimerFactory.timers.

Returns a read-only map from Timer names to Timers.

Annotations
@Override
updateActivationback to summary
pack-priv void updateActivation()
org.glassfish.pfl.tf.timer.impl back to summary

public Class TimerFactoryImpl.TracingEventHandler

extends NamedBase
implements TimerEventHandler
Class Inheritance
All Implemented Interfaces
org.glassfish.pfl.tf.timer.spi.TimerEventHandler, org.glassfish.pfl.tf.timer.spi.Named

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from org.glassfish.pfl.tf.timer.spi.NamedBase:
equalsfactoryhashCodenamesetFactorytoString

Constructor Detail

TracingEventHandlerback to summary
public TracingEventHandler(TimerFactory factory, String name)

Method Detail

notifyback to summary
public void notify(TimerEvent event)

Implements org.glassfish.pfl.tf.timer.spi.TimerEventHandler.notify.

Annotations
@Override