
public abstract class Negotiator<STATE extends Enum<?>,EVENT extends Enum<?>> extends FiniteStateMachine<STATE,EVENT,INegotiationContext> implements INegotiator, INegotiationContext.Receiver
FiniteStateMachine.ChangeStateTransition, FiniteStateMachine.FailTransition, FiniteStateMachine.IgnoreTransition, FiniteStateMachine.StateChangedEventILifecycle.DeferrableActivationFAIL, IGNORE| Constructor and Description |
|---|
Negotiator(Class<STATE> stateEnum,
Class<EVENT> eventEnum,
STATE initialState,
STATE successState,
STATE failureState,
EVENT startEvent,
EVENT bufferEvent,
boolean initiator) |
| Modifier and Type | Method and Description |
|---|---|
EVENT |
getBufferEvent() |
STATE |
getFailureState() |
STATE |
getInitialState() |
EVENT |
getStartEvent() |
STATE |
getSuccessState() |
protected void |
handleFailure(INegotiationContext context) |
protected void |
handleSuccess(INegotiationContext context) |
boolean |
isInitiator() |
void |
negotiate(INegotiationContext context) |
protected void |
postProcess(INegotiationContext context) |
void |
receiveBuffer(INegotiationContext context,
ByteBuffer buffer) |
changeState, createFailTransition, createIgnoreTransition, formatFailMessage, formatIgnoreMessage, formatProcessMessage, getEvents, getState, getStates, getTransition, init, init, initAll, initAll, initEvents, initEvents, initStates, initStates, process, setStateactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringaddListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getListeners, hasListeners, removeListenerpublic STATE getInitialState()
public STATE getSuccessState()
public STATE getFailureState()
public EVENT getBufferEvent()
public EVENT getStartEvent()
public boolean isInitiator()
isInitiator in interface INegotiatorpublic void negotiate(INegotiationContext context)
negotiate in interface INegotiatorpublic void receiveBuffer(INegotiationContext context, ByteBuffer buffer)
receiveBuffer in interface INegotiationContext.Receiverprotected void postProcess(INegotiationContext context)
protected void handleSuccess(INegotiationContext context)
protected void handleFailure(INegotiationContext context)
Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.