public class PeerFSMImpl extends Object implements IStateMachine
| Modifier and Type | Class and Description |
|---|---|
protected class |
PeerFSMImpl.MyState |
| Modifier and Type | Field and Description |
|---|---|
protected long |
CEA_TIMEOUT |
protected IConcurrentFactory |
concurrentFactory |
protected IContext |
context |
protected Dictionary |
dictionary |
protected long |
DPA_TIMEOUT |
protected long |
DWA_TIMEOUT |
protected LinkedBlockingQueue<StateEvent> |
eventQueue |
protected long |
IAC_TIMEOUT |
protected ConcurrentLinkedQueue<StateChangeListener> |
listeners |
protected boolean |
mustRun |
protected AtomicInteger |
numberOfThreadsRunning |
protected int |
predefSize |
protected IStatistic |
queueStat |
protected Random |
random |
protected long |
REC_TIMEOUT |
protected FsmState |
state |
protected State[] |
states |
protected IStatisticManager |
statisticFactory |
protected IStatisticRecord |
timeCount |
protected StateEvent |
timeOutEvent |
protected long |
timer |
protected IStatisticRecord |
timeSumm |
protected boolean |
watchdogSent |
| Constructor and Description |
|---|
PeerFSMImpl(IContext aContext,
IConcurrentFactory concurrentFactory,
Configuration config,
IStatisticManager statisticFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addStateChangeNotification(StateChangeListener stateChangeListener) |
double |
getQueueInfo()
This method returns occupancy of event queue
|
<E> E |
getState(Class<E> a) |
protected State[] |
getStates() |
IStatistic |
getStatistic() |
boolean |
handleEvent(StateEvent event) |
protected void |
loadTimeOuts(Configuration config) |
void |
removeStateChangeNotification(StateChangeListener stateChangeListener) |
void |
remStateChangeNotification(StateChangeListener stateChangeListener) |
protected void |
setInActiveTimer() |
protected void |
switchToNextState(FsmState newState) |
String |
toString() |
protected final Dictionary dictionary
protected ConcurrentLinkedQueue<StateChangeListener> listeners
protected LinkedBlockingQueue<StateEvent> eventQueue
protected FsmState state
protected boolean watchdogSent
protected long timer
protected long CEA_TIMEOUT
protected long IAC_TIMEOUT
protected long REC_TIMEOUT
protected long DWA_TIMEOUT
protected long DPA_TIMEOUT
protected final StateEvent timeOutEvent
protected Random random
protected IConcurrentFactory concurrentFactory
protected IContext context
protected State[] states
protected int predefSize
protected IStatisticManager statisticFactory
protected IStatistic queueStat
protected IStatisticRecord timeSumm
protected IStatisticRecord timeCount
protected boolean mustRun
protected AtomicInteger numberOfThreadsRunning
public PeerFSMImpl(IContext aContext, IConcurrentFactory concurrentFactory, Configuration config, IStatisticManager statisticFactory)
public IStatistic getStatistic()
getStatistic in interface IStateMachinepublic void removeStateChangeNotification(StateChangeListener stateChangeListener)
removeStateChangeNotification in interface StateMachinepublic double getQueueInfo()
IStateMachinegetQueueInfo in interface IStateMachineprotected void loadTimeOuts(Configuration config)
public void addStateChangeNotification(StateChangeListener stateChangeListener)
addStateChangeNotification in interface StateMachinepublic void remStateChangeNotification(StateChangeListener stateChangeListener)
remStateChangeNotification in interface IStateMachineprotected void switchToNextState(FsmState newState)
public boolean handleEvent(StateEvent event) throws InternalError, OverloadException
handleEvent in interface StateMachineInternalErrorOverloadExceptionprotected void setInActiveTimer()
public <E> E getState(Class<E> a)
getState in interface StateMachineprotected State[] getStates()
Copyright © 2016. All Rights Reserved.