tcMenuJavaAPI
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
com.thecoderscorner.menu.remote.states.BaseMessageProcessingState Class Referenceabstract
Inheritance diagram for com.thecoderscorner.menu.remote.states.BaseMessageProcessingState:
com.thecoderscorner.menu.remote.states.RemoteConnectorState com.thecoderscorner.menu.remote.states.AwaitingBootstrapState com.thecoderscorner.menu.remote.states.BootstrapInProgressState com.thecoderscorner.menu.remote.states.ConnectionReadyState com.thecoderscorner.menu.remote.states.JoinMessageArrivedState com.thecoderscorner.menu.remote.states.SendPairingMessageState com.thecoderscorner.menu.remote.states.SerialAwaitFirstMsgState com.thecoderscorner.menu.remote.states.SocketAwaitJoinState

Public Member Functions

void enterState ()
 
void runLoop ()
 
void exitState (RemoteConnectorState nextState)
 
- Public Member Functions inherited from com.thecoderscorner.menu.remote.states.RemoteConnectorState
AuthStatus getAuthenticationStatus ()
 
boolean canSendCommandToRemote (MenuCommand command)
 

Protected Member Functions

 BaseMessageProcessingState (RemoteConnectorContext context)
 
abstract void processTimeout ()
 
abstract boolean processMessage (MenuCommand cmd)
 
void markDone ()
 
boolean checkIfThereIsAnHbEnd (MenuCommand cmd)
 

Protected Attributes

final System.Logger logger = System.getLogger(getClass().getSimpleName())
 
final RemoteConnectorContext context
 
AtomicInteger disconnectInterval = new AtomicInteger(5000)
 
AtomicLong lastReception = new AtomicLong(0)
 

Member Function Documentation

◆ enterState()

void com.thecoderscorner.menu.remote.states.BaseMessageProcessingState.enterState ( )

◆ exitState()

void com.thecoderscorner.menu.remote.states.BaseMessageProcessingState.exitState ( RemoteConnectorState  nextState)

called when a state machine class is deactivated

Implements com.thecoderscorner.menu.remote.states.RemoteConnectorState.

Reimplemented in com.thecoderscorner.menu.remote.states.ConnectionReadyState.

◆ runLoop()

void com.thecoderscorner.menu.remote.states.BaseMessageProcessingState.runLoop ( )

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.

Implements com.thecoderscorner.menu.remote.states.RemoteConnectorState.


The documentation for this class was generated from the following file: