Class ObservableLifecycleRequestMachine<SRC>

java.lang.Object
org.refcodes.component.LifecycleMachine
org.refcodes.component.ext.observer.ObservableLifecycleRequestMachine<SRC>
Type Parameters:
SRC - The source of the events consumed by the LifecycleRequestObserver.
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<LifecycleRequestObserver<InitializeRequestedEvent<SRC>,StartRequestedEvent<SRC>,ResumeRequestedEvent<SRC>,PauseRequestedEvent<SRC>,StopRequestedEvent<SRC>,DestroyRequestedEvent<SRC>,org.refcodes.observer.EventMetaData,SRC>>

public class ObservableLifecycleRequestMachine<SRC> extends org.refcodes.component.LifecycleMachine implements org.refcodes.observer.Observable<LifecycleRequestObserver<InitializeRequestedEvent<SRC>,StartRequestedEvent<SRC>,ResumeRequestedEvent<SRC>,PauseRequestedEvent<SRC>,StopRequestedEvent<SRC>,DestroyRequestedEvent<SRC>,org.refcodes.observer.EventMetaData,SRC>>
The ObservableLifecycleRequestMachine extends the LifecycleMachine with request ActionEvent functionality which can be vetoed. The implementation is suffixed with "Machine" instead of "Automaton" for differentiation with any interface of similar (same) name.
  • Constructor Details

    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine()
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

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

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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.
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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).
    • ObservableLifecycleRequestMachine

      public ObservableLifecycleRequestMachine(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

    • hasObserver

      Specified by:
      hasObserver in interface org.refcodes.observer.Observable<SRC>
    • subscribeObserver

      Specified by:
      subscribeObserver in interface org.refcodes.observer.Observable<SRC>
    • unsubscribeObserver

      Specified by:
      unsubscribeObserver in interface org.refcodes.observer.Observable<SRC>
    • initialize

      public void initialize() throws org.refcodes.component.InitializeException
      Specified by:
      initialize in interface org.refcodes.component.Initializable
      Overrides:
      initialize in class org.refcodes.component.LifecycleMachine
      Throws:
      org.refcodes.component.InitializeException
    • start

      public void start() throws org.refcodes.component.StartException
      Specified by:
      start in interface org.refcodes.component.Startable
      Overrides:
      start in class org.refcodes.component.LifecycleMachine
      Throws:
      org.refcodes.component.StartException
    • pause

      public void pause() throws org.refcodes.component.PauseException
      Specified by:
      pause in interface org.refcodes.component.Pausable
      Overrides:
      pause in class org.refcodes.component.LifecycleMachine
      Throws:
      org.refcodes.component.PauseException
    • resume

      public void resume() throws org.refcodes.component.ResumeException
      Specified by:
      resume in interface org.refcodes.component.Resumable
      Overrides:
      resume in class org.refcodes.component.LifecycleMachine
      Throws:
      org.refcodes.component.ResumeException
    • stop

      public void stop() throws org.refcodes.component.StopException
      Specified by:
      stop in interface org.refcodes.component.Stoppable
      Overrides:
      stop in class org.refcodes.component.LifecycleMachine
      Throws:
      org.refcodes.component.StopException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.refcodes.component.Destroyable
      Overrides:
      destroy in class org.refcodes.component.LifecycleMachine