akka.remote.testconductor
Class BarrierCoordinator

java.lang.Object
  extended by akka.remote.testconductor.BarrierCoordinator
All Implemented Interfaces:
Actor, ActorLogging, FSM<BarrierCoordinator.State,BarrierCoordinator.Data>, LoggingFSM<BarrierCoordinator.State,BarrierCoordinator.Data>, Listeners

public class BarrierCoordinator
extends java.lang.Object
implements Actor, LoggingFSM<BarrierCoordinator.State,BarrierCoordinator.Data>

This barrier coordinator gets informed of players connecting (NodeInfo), players being deliberately removed (RemoveClient) or failing (ClientDisconnected) by the controller. It also receives EnterBarrier requests, where upon the first one received the name of the current barrier is set and all other known clients are expected to join the barrier, whereupon all of the will be sent the successful EnterBarrier return message. In case of planned removals, this may just happen earlier, in case of failures the current barrier (and all subsequent ones) will be failed by sending BarrierFailed responses.

INTERNAL API.


Nested Class Summary
static class BarrierCoordinator.BarrierEmpty
           
static class BarrierCoordinator.BarrierEmpty$
           
static class BarrierCoordinator.BarrierTimeout
           
static class BarrierCoordinator.BarrierTimeout$
           
static class BarrierCoordinator.ClientLost
           
static class BarrierCoordinator.ClientLost$
           
static class BarrierCoordinator.Data
           
static class BarrierCoordinator.Data$
           
static class BarrierCoordinator.DuplicateNode
           
static class BarrierCoordinator.DuplicateNode$
           
static class BarrierCoordinator.FailedBarrier
           
static class BarrierCoordinator.FailedBarrier$
           
static class BarrierCoordinator.Idle$
           
static interface BarrierCoordinator.Printer
           
static class BarrierCoordinator.RemoveClient
           
static class BarrierCoordinator.RemoveClient$
           
static interface BarrierCoordinator.State
           
static class BarrierCoordinator.Waiting$
           
static class BarrierCoordinator.WrongBarrier
           
static class BarrierCoordinator.WrongBarrier$
           
 
Nested classes/interfaces inherited from interface akka.actor.FSM
FSM.$minus$greater$, FSM.CurrentState<S>, FSM.CurrentState$, FSM.Event<D>, FSM.Event$, FSM.Failure, FSM.Failure$, FSM.LogEntry<S,D>, FSM.LogEntry$, FSM.Normal$, FSM.NullFunction$, FSM.Reason, FSM.Shutdown$, FSM.State$, FSM.StateTimeout$, FSM.StopEvent<S,D>, FSM.StopEvent$, FSM.SubscribeTransitionCallBack, FSM.SubscribeTransitionCallBack$, FSM.TimeoutMarker, FSM.TimeoutMarker$, FSM.Timer, FSM.Timer$, FSM.TransformHelper, FSM.Transition<S>, FSM.Transition$, FSM.UnsubscribeTransitionCallBack, FSM.UnsubscribeTransitionCallBack$
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
BarrierCoordinator()
           
 
Method Summary
 boolean failed()
           
 scala.concurrent.duration.Deadline getDeadline(scala.Option<scala.concurrent.duration.FiniteDuration> timeout)
           
 FSM.State<BarrierCoordinator.State,BarrierCoordinator.Data> handleBarrier(BarrierCoordinator.Data data)
           
 void postRestart(java.lang.Throwable reason)
          User overridable callback: By default it calls preStart().
 void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          User overridable callback: '''By default it disposes of all children and then calls postStop().'''
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.actor.LoggingFSM
advance, debugEvent, events, full, getLog, logDepth, pos, processEvent, states
 
Methods inherited from interface akka.actor.FSM
applyState, cancelTimer, currentState, Event, generation, handleEvent, handleEventDefault, handleTransition, initialize, isStateTimerActive, isTimerActive, logTermination, makeTransition, nextState, nextStateData, onTermination, onTransition, processMsg, register, setStateTimeout, setTimer, startWith, stateData, stateFunctions, stateName, StateTimeout, stateTimeouts, stay, stop, stop, stop, StopEvent, terminate, terminateEvent, timeoutFuture, timerGen, timers, total2pf, transform, transitionEvent, when, whenUnhandled
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, preStart, self, sender, supervisorStrategy, unhandled
 
Methods inherited from interface akka.routing.Listeners
gossip, listenerManagement, listeners
 
Methods inherited from interface akka.actor.ActorLogging
_log, log
 

Constructor Detail

BarrierCoordinator

public BarrierCoordinator()
Method Detail

failed

public boolean failed()

preRestart

public void preRestart(java.lang.Throwable reason,
                       scala.Option<java.lang.Object> message)
Description copied from interface: Actor
User overridable callback: '''By default it disposes of all children and then calls postStop().'''

Specified by:
preRestart in interface Actor
Parameters:
reason - the Throwable that caused the restart to happen
message - optionally the current message the actor processed when failing, if applicable

Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated.

postRestart

public void postRestart(java.lang.Throwable reason)
Description copied from interface: Actor
User overridable callback: By default it calls preStart().

Specified by:
postRestart in interface Actor
Parameters:
reason - the Throwable that caused the restart to happen

Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.

handleBarrier

public FSM.State<BarrierCoordinator.State,BarrierCoordinator.Data> handleBarrier(BarrierCoordinator.Data data)

getDeadline

public scala.concurrent.duration.Deadline getDeadline(scala.Option<scala.concurrent.duration.FiniteDuration> timeout)