Package org.glassfish.pfl.tf.timer.impl
Class ControllableBase
java.lang.Object
org.glassfish.pfl.tf.timer.spi.NamedBase
org.glassfish.pfl.tf.timer.impl.NamedBaseImpl
org.glassfish.pfl.tf.timer.impl.ControllableBase
- All Implemented Interfaces:
Controllable,Named
- Direct Known Subclasses:
TimerGroupImpl,TimerImpl
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedControllableBase(int id, String name, String description, TimerFactoryImpl factory) -
Method Summary
Modifier and TypeMethodDescriptioncontents()Return an unmodifiable set of the contents of this Controllable.A longer description giving some details of the meaning of this Controllable.voiddisable()Disable this controllable.voidenable()Enable this controllable.intid()A small id for this controllable.final booleanReturn true if enable() was called, otherwise false if enable() was never called, or disable() was last called.Methods inherited from class org.glassfish.pfl.tf.timer.impl.NamedBaseImpl
factoryMethods inherited from class org.glassfish.pfl.tf.timer.spi.NamedBase
equals, hashCode, name, setFactory, toString
-
Constructor Details
-
ControllableBase
-
-
Method Details
-
id
public int id()Description copied from interface:ControllableA small id for this controllable. Each controllable created from the same TimerFactory will have a unique ID. All ids will be small integers starting at 0 (so indexing tables by timer ID is supported).- Specified by:
idin interfaceControllable
-
description
Description copied from interface:ControllableA longer description giving some details of the meaning of this Controllable.- Specified by:
descriptionin interfaceControllable
-
isEnabled
public final boolean isEnabled()Description copied from interface:ControllableReturn true if enable() was called, otherwise false if enable() was never called, or disable() was last called.- Specified by:
isEnabledin interfaceControllable
-
contents
Description copied from interface:ControllableReturn an unmodifiable set of the contents of this Controllable. May always be empty for some subclasses of Controllable.- Specified by:
contentsin interfaceControllable
-
enable
public void enable()Description copied from interface:ControllableEnable this controllable. All Timers that are either enabled, or reachable via contents() from an enabled Controllable are activated, and will cause TimerEvents to be generated when passed to the TimerEventController enter and exit methods.- Specified by:
enablein interfaceControllable
-
disable
public void disable()Description copied from interface:ControllableDisable this controllable.- Specified by:
disablein interfaceControllable
-