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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private static final Set
<ControllableBase> private int
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ControllableBase
(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.(package private) void
description
(String description) void
disable()
Disable this controllable.void
enable()
Enable this controllable.int
id()
A small id for this controllable.final boolean
Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.(package private) void
transitiveClosure
(Set<ControllableBase> result) Methods inherited from class org.glassfish.pfl.tf.timer.impl.NamedBaseImpl
factory
Methods inherited from class org.glassfish.pfl.tf.timer.spi.NamedBase
equals, hashCode, name, setFactory, toString
-
Field Details
-
emptyContent
-
id
private int id -
description
-
isEnabled
private boolean isEnabled
-
-
Constructor Details
-
ControllableBase
-
-
Method Details
-
id
public int id()Description copied from interface:Controllable
A 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:
id
in interfaceControllable
-
description
Description copied from interface:Controllable
A longer description giving some details of the meaning of this Controllable.- Specified by:
description
in interfaceControllable
-
description
-
isEnabled
public final boolean isEnabled()Description copied from interface:Controllable
Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.- Specified by:
isEnabled
in interfaceControllable
-
contents
Description copied from interface:Controllable
Return an unmodifiable set of the contents of this Controllable. May always be empty for some subclasses of Controllable.- Specified by:
contents
in interfaceControllable
-
enable
public void enable()Description copied from interface:Controllable
Enable 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:
enable
in interfaceControllable
-
disable
public void disable()Description copied from interface:Controllable
Disable this controllable.- Specified by:
disable
in interfaceControllable
-
transitiveClosure
-