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
public abstract class ControllableBase extends NamedBaseImpl implements Controllable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdescriptionprivate static java.util.Set<ControllableBase>emptyContentprivate intidprivate booleanisEnabled
-
Constructor Summary
Constructors Modifier Constructor Description protectedControllableBase(int id, java.lang.String name, java.lang.String description, TimerFactoryImpl factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ControllableBase>contents()Return an unmodifiable set of the contents of this Controllable.java.lang.Stringdescription()A longer description giving some details of the meaning of this Controllable.(package private) voiddescription(java.lang.String description)voiddisable()Disable this controllable.voidenable()Enable this controllable.intid()A small id for this controllable.booleanisEnabled()Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.(package private) voidtransitiveClosure(java.util.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 Detail
-
emptyContent
private static final java.util.Set<ControllableBase> emptyContent
-
id
private int id
-
description
private java.lang.String description
-
isEnabled
private boolean isEnabled
-
-
Constructor Detail
-
ControllableBase
protected ControllableBase(int id, java.lang.String name, java.lang.String description, TimerFactoryImpl factory)
-
-
Method Detail
-
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
public java.lang.String description()
Description copied from interface:ControllableA longer description giving some details of the meaning of this Controllable.- Specified by:
descriptionin interfaceControllable
-
description
void description(java.lang.String description)
-
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
public java.util.Set<ControllableBase> 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
-
transitiveClosure
void transitiveClosure(java.util.Set<ControllableBase> result)
-
-