Class ObservableLifecycleStatusMachine<SRC>

java.lang.Object
org.refcodes.component.LifecycleMachine
org.refcodes.component.ext.observer.ObservableLifecycleStatusMachine<SRC>
Type Parameters:
SRC - The source of the events consumed by the LifecycleStatusObserver.
All Implemented Interfaces:
org.refcodes.component.Destroyable, org.refcodes.component.Destroyable.DestroyAutomaton, org.refcodes.component.Initializable, org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.InitializedAccessor, org.refcodes.component.LifecycleComponent, org.refcodes.component.LifecycleComponent.LifecycleAutomaton, org.refcodes.component.LifecycleStatusAccessor, org.refcodes.component.Pausable, org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Resumable, org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.RunningAccessor, org.refcodes.component.Startable, org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Stoppable, org.refcodes.component.Stoppable.StopAutomaton, org.refcodes.observer.Observable<LifecycleStatusObserver<InitializeAccomplishedEvent<SRC>,StartAccomplishedEvent<SRC>,ResumeAccomplishedEvent<SRC>,PauseAccomplishedEvent<SRC>,StopAccomplishedEvent<SRC>,DestroyAccomplishedEvent<SRC>,org.refcodes.observer.EventMetaData,SRC>>

public class ObservableLifecycleStatusMachine<SRC> extends org.refcodes.component.LifecycleMachine implements org.refcodes.component.LifecycleComponent.LifecycleAutomaton, org.refcodes.observer.Observable<LifecycleStatusObserver<InitializeAccomplishedEvent<SRC>,StartAccomplishedEvent<SRC>,ResumeAccomplishedEvent<SRC>,PauseAccomplishedEvent<SRC>,StopAccomplishedEvent<SRC>,DestroyAccomplishedEvent<SRC>,org.refcodes.observer.EventMetaData,SRC>>
The ObservableLifecycleStatusMachine extends the LifecycleMachine with life-cycle ActionEvent functionality which can be vetoed, such running through several stages from getting started till being destroyed. The valid state changes are mainly as follows: "start" - "pause" - "resume" - "stop" - "destroy" For example: "start" - "pause" - "resume" - "pause" - "resume" - "stop" - "start" - "pause" - "resume" - "stop" - "destroy" The implementation is suffixed with "Machine" instead of "Automaton" for differentiation with any interface of similar (same) name.
  • Constructor Details

    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine()
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(SRC aSource)
      Parameters:
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.observer.EventMetaData aEventMetaData)
      Parameters:
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.observer.EventMetaData aEventMetaData, SRC aSource)
      Parameters:
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, SRC aSource)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, org.refcodes.observer.EventMetaData aEventMetaData)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, org.refcodes.observer.EventMetaData aEventMetaData, SRC aSource)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(SRC aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.observer.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.observer.EventMetaData aEventMetaData, SRC aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, SRC aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, org.refcodes.observer.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableLifecycleStatusMachine

      public ObservableLifecycleStatusMachine(org.refcodes.component.LifecycleComponent aLifecycleComponent, org.refcodes.observer.EventMetaData aEventMetaData, SRC aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Parameters:
      aLifecycleComponent - The LifecycleComponent to which the life-cycle method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing ActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing ActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
  • Method Details