Package org.nustaq.kontraktor.routers
Class HotColdFailoverKrouter<T extends HotColdFailoverKrouter>
java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<T>
org.nustaq.kontraktor.routers.AbstractKrouter<T>
org.nustaq.kontraktor.routers.SingleActiveServiceKrouter<T>
org.nustaq.kontraktor.routers.HotColdFailoverKrouter<T>
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Executor,Monitorable,RemotedActor,ServingActor
- Direct Known Subclasses:
RoundRobinKrouter
public class HotColdFailoverKrouter<T extends HotColdFailoverKrouter> extends SingleActiveServiceKrouter<T>
Simple HotCold failover router - several service instances might connect, but only
first one is used (as long it is connected). Once this instance disconnect, the next one is used.
Note that implementing routing (+tweaks) require to break idiomatic concurrency handling of kontraktor, anyway this
is not visible to outer world.
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.nustaq.kontraktor.routers.AbstractKrouter
CLIENT_PING_INTERVAL_MS, clients, lastSwitch, nextAliveRemoteActors, SERVICE_UNAVAILABLE, timeoutMapFields inherited from class org.nustaq.kontraktor.Actor
__cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallbackFields inherited from class org.nustaq.kontraktor.Actors
CONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version -
Constructor Summary
Constructors Constructor Description HotColdFailoverKrouter() -
Method Summary
Modifier and Type Method Description protected ActorgetRemoteRef()protected java.util.List<Actor>getServices()voidinit()voidrouter$handleServiceDisconnect(Actor x)protected voidsetRemoteRef(Actor remoteRef)Methods inherited from class org.nustaq.kontraktor.routers.SingleActiveServiceKrouter
dispatchRemoteCall, main, router$RegisterService, willDispatchMethods inherited from class org.nustaq.kontraktor.routers.AbstractKrouter
__dispatchRemoteCall, checkPingOnClients, clientConnected, clientDisconnected, createErrorPromiseResponse, forwardCall, forwardCallInternal, forwardMultiCall, forwardMultiCallInternal, getClientPingTimeout, getServicePingTimeout, handleServiceDiscon, hasBeenUnpublished, isStateful, pingServices, router$clientPing, sendFailoverNotification, sendFailoverNotificationInternalMethods inherited from class org.nustaq.kontraktor.Actor
__addDeadLetter, __addRemoteConnection, __addStopHandler, __enqueueCall, __getCachedMethod, __removeRemoteConnection, __stop, __stopImpl, __submit, ask, askMsg, asyncstop, checkThread, close, closeCurrentClient, current, cyclic, debounce, delayed, execInThreadPool, execute, getActor, getActorRef, getCallbackSize, getConnections, getCurrentDispatcher, getFactory, getMailboxSize, getQSizes, getReport, getScheduler, getSubMonitorables, getUntypedRef, hasStopped, inside, inThread, isCallbackQPressured, isEmpty, isMailboxPressured, isProxy, isPublished, isRemote, isStopped, ping, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGCMethods inherited from class org.nustaq.kontraktor.Actors
AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, kYield, kYield, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yieldCallbacks
-
Constructor Details
-
HotColdFailoverKrouter
public HotColdFailoverKrouter()
-
-
Method Details
-
init
public void init()- Overrides:
initin classSingleActiveServiceKrouter<T extends HotColdFailoverKrouter>
-
router$handleServiceDisconnect
- Specified by:
router$handleServiceDisconnectin classSingleActiveServiceKrouter<T extends HotColdFailoverKrouter>
-
getRemoteRef
- Specified by:
getRemoteRefin classSingleActiveServiceKrouter<T extends HotColdFailoverKrouter>
-
setRemoteRef
- Specified by:
setRemoteRefin classSingleActiveServiceKrouter<T extends HotColdFailoverKrouter>
-
getServices
- Overrides:
getServicesin classSingleActiveServiceKrouter<T extends HotColdFailoverKrouter>
-