Class BaseMessageProcessingState

java.lang.Object
com.thecoderscorner.menu.remote.states.BaseMessageProcessingState
All Implemented Interfaces:
RemoteConnectorState
Direct Known Subclasses:
AwaitingBootstrapState, BootstrapInProgressState, ConnectionReadyState, JoinMessageArrivedState, SendPairingMessageState, SerialAwaitFirstMsgState, SocketAwaitJoinState

public abstract class BaseMessageProcessingState extends Object implements RemoteConnectorState
  • Field Details

  • Constructor Details

  • Method Details

    • enterState

      public void enterState()
      Description copied from interface: RemoteConnectorState
      called when a state machine class becomes active
      Specified by:
      enterState in interface RemoteConnectorState
    • runLoop

      public void runLoop()
      Description copied from interface: RemoteConnectorState
      called when a state is the current state, the state can read messages and attempt connections in this loop. It must be returned once the state is exited to avoid deadlocking the API. Exceptions can be thrown by the loop safely and will be logged in the connection logic.
      Specified by:
      runLoop in interface RemoteConnectorState
    • processTimeout

      protected abstract void processTimeout()
    • processMessage

      protected abstract boolean processMessage(MenuCommand cmd)
    • markDone

      protected void markDone()
    • exitState

      public void exitState(RemoteConnectorState nextState)
      Description copied from interface: RemoteConnectorState
      called when a state machine class is deactivated
      Specified by:
      exitState in interface RemoteConnectorState
    • checkIfThereIsAnHbEnd

      protected boolean checkIfThereIsAnHbEnd(MenuCommand cmd)