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 java.lang.Object implements RemoteConnectorState
-
-
Field Summary
Fields Modifier and Type Field Description protected RemoteConnectorContextcontextprotected java.util.concurrent.atomic.AtomicIntegerdisconnectIntervalprotected java.util.concurrent.atomic.AtomicLonglastReceptionprotected java.lang.System.Loggerlogger
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseMessageProcessingState(RemoteConnectorContext context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckIfThereIsAnHbEnd(MenuCommand cmd)voidenterState()called 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 voidprocessTimeout()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.thecoderscorner.menu.remote.states.RemoteConnectorState
canSendCommandToRemote, getAuthenticationStatus
-
-
-
-
Field Detail
-
logger
protected final java.lang.System.Logger logger
-
context
protected final RemoteConnectorContext context
-
disconnectInterval
protected java.util.concurrent.atomic.AtomicInteger disconnectInterval
-
lastReception
protected java.util.concurrent.atomic.AtomicLong lastReception
-
-
Constructor Detail
-
BaseMessageProcessingState
protected BaseMessageProcessingState(RemoteConnectorContext context)
-
-
Method Detail
-
enterState
public void enterState()
Description copied from interface:RemoteConnectorStatecalled when a state machine class becomes active- Specified by:
enterStatein interfaceRemoteConnectorState
-
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:RemoteConnectorStatecalled when a state machine class is deactivated- Specified by:
exitStatein interfaceRemoteConnectorState
-
checkIfThereIsAnHbEnd
protected boolean checkIfThereIsAnHbEnd(MenuCommand cmd)
-
-