Class ControllableBase

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ControllableBase​(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.String description()
      A longer description giving some details of the meaning of this Controllable.
      (package private) void description​(java.lang.String description)  
      void disable()
      Disable this controllable.
      void enable()
      Enable this controllable.
      int id()
      A small id for this controllable.
      boolean isEnabled()
      Return true if enable() was called, otherwise false if enable() was never called, or disable() was last called.
      (package private) void transitiveClosure​(java.util.Set<ControllableBase> result)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.glassfish.pfl.tf.timer.spi.Named

        factory, name
    • 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: 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 interface Controllable
      • description

        public java.lang.String description()
        Description copied from interface: Controllable
        A longer description giving some details of the meaning of this Controllable.
        Specified by:
        description in interface Controllable
      • description

        void description​(java.lang.String 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 interface Controllable
      • contents

        public java.util.Set<ControllableBase> 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 interface Controllable
      • 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 interface Controllable
      • disable

        public void disable()
        Description copied from interface: Controllable
        Disable this controllable.
        Specified by:
        disable in interface Controllable
      • transitiveClosure

        void transitiveClosure​(java.util.Set<ControllableBase> result)