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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RemoteConnectorContextprotected AtomicIntegerprotected AtomicLongprotected System.Logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidcalled when a state machine class becomes activevoidexitState(RemoteConnectorState nextState)called when a state machine class is deactivatedprotected voidmarkDone()protected abstract booleanprocessMessage(MenuCommand cmd)protected abstract voidvoidrunLoop()called when a state is the current state, the state can read messages and attempt connections in this loop.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.thecoderscorner.menu.remote.states.RemoteConnectorState
canSendCommandToRemote, getAuthenticationStatus
-
Field Details
-
logger
-
context
-
disconnectInterval
-
lastReception
-
-
Constructor Details
-
Method Details
-
enterState
public void enterState()Description copied from interface:RemoteConnectorStatecalled when a state machine class becomes active- Specified by:
enterStatein interfaceRemoteConnectorState
-
runLoop
public void runLoop()Description copied from interface:RemoteConnectorStatecalled 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:
runLoopin interfaceRemoteConnectorState
-
processTimeout
protected abstract void processTimeout() -
markDone
protected void markDone()
-