Package org.glassfish.pfl.tf.timer.spi
Interface Controllable
- All Superinterfaces:
Named
- All Known Subinterfaces:
Timer
,TimerFactory
,TimerGroup
- All Known Implementing Classes:
ControllableBase
,TimerFactoryImpl
,TimerGroupImpl
,TimerImpl
Represents a named object that can be enabled or disabled.
It may also contain other Controllable instances.
-
Method Summary
Modifier and TypeMethodDescriptionSet
<? extends Controllable> contents()
Return an unmodifiable set of the contents of this Controllable.A longer description giving some details of the meaning of this Controllable.void
disable()
Disable this controllable.void
enable()
Enable this controllable.int
id()
A small id for this controllable.boolean
Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.
-
Method Details
-
description
String description()A longer description giving some details of the meaning of this Controllable. -
id
int id()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). -
contents
Set<? extends Controllable> contents()Return an unmodifiable set of the contents of this Controllable. May always be empty for some subclasses of Controllable. -
enable
void enable()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. -
disable
void disable()Disable this controllable. -
isEnabled
boolean isEnabled()Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.
-