Package pygar.state

Class PmsgComplexStateMachine

java.lang.Object
java.util.Observable
pygar.state.PmsgComplexStateMachine
All Implemented Interfaces:
java.util.Observer

@ThreadSafe
public class PmsgComplexStateMachine
extends java.util.Observable
implements java.util.Observer
UNDER CONSTRUCTION!! NOT READY FOR USE This class implements a special type of compound state machine that is composed of instances of the PmessageStateMachine superclass. The specialization allows an instance of this class to receive messages and then route them to the component state machines based on the session, groupID, and senderID. The class itself exhibits three predefined states: sBegin, sActive, sEnd which correspond to the initial situation, the state when the entire state machine is active and the state reached when all the components have reached their final state. The class is modelled on StateMachine but it is not a subclass because we not want to support any but the predefined states; therefore, addTransition() is not available in this class. N.b. not currently in use anywhere. Requires modifications to use current version of other classes. See especially //TODO CRITICAL where code is commented out
  • Constructor Summary

    Constructors 
    Constructor Description
    PmsgComplexStateMachine()  
  • Method Summary

    Modifier and Type Method Description
    void acceptEvent​(java.lang.String event, Pmessage context)  
    java.lang.String getState()  
    static void main​(java.lang.String[] args)  
    void setState​(java.lang.String state)  
    void update​(java.util.Observable o, java.lang.Object arg)
    The update method conforms to the interface Observer but requires

    Methods inherited from class java.util.Observable

    addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getState

      public java.lang.String getState()
    • setState

      public void setState​(java.lang.String state)
    • acceptEvent

      public void acceptEvent​(java.lang.String event, Pmessage context)
    • update

      public void update​(java.util.Observable o, java.lang.Object arg)
      The update method conforms to the interface Observer but requires
      Specified by:
      update in interface java.util.Observer
      Parameters:
      o - the object that issues the update request
      arg - the Pmessage object - all others cause a failed casting operation.
    • main

      public static void main​(java.lang.String[] args)
      Parameters:
      args -