public abstract class AbstractKrouter<T extends AbstractKrouter> extends Actor<T> implements RemotedActor, ServingActor
Actor.ActorReport| Modifier and Type | Field and Description |
|---|---|
static long |
CLIENT_PING_INTERVAL_MS
client connection loss detection can be slow (just needed for resource cleanup)
|
protected HashMap<String,ConnectionRegistry> |
clients |
protected long |
lastSwitch |
protected Set<Long> |
nextAliveRemoteActors |
static String |
SERVICE_UNAVAILABLE |
protected HashMap<Object,Long> |
timeoutMap |
__cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallbackCONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version| Constructor and Description |
|---|
AbstractKrouter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
__dispatchRemoteCall(ObjectSocket objSocket,
RemoteCallEntry rce,
ConnectionRegistry clientRemoteRegistry,
List<IPromise> createdFutures,
Object authContext,
BiFunction<Actor,String,Boolean> callInterceptor,
long delayCode)
called if a message invokation from remote is received
|
void |
checkPingOnClients() |
void |
clientConnected(ConnectionRegistry connectionRegistry,
String connectionIdentifier) |
void |
clientDisconnected(ConnectionRegistry connectionRegistry,
String connectionIdentifier) |
protected RemoteCallEntry |
createErrorPromiseResponse(RemoteCallEntry rce,
ConnectionRegistry clientRemoteRegistry) |
protected abstract boolean |
dispatchRemoteCall(RemoteCallEntry rce,
ConnectionRegistry clientRemoteRegistry)
dispatch call to a service.
|
protected void |
forwardCall(RemoteCallEntry rce,
Actor remoteRef,
ConnectionRegistry clientRemoteRegistry) |
protected void |
forwardCallInternal(RemoteCallEntry rce,
Actor remoteRef,
ConnectionRegistry clientRemoteRegistry) |
protected void |
forwardMultiCall(RemoteCallEntry rce,
Actor remoteRef,
ConnectionRegistry clientRemoteRegistry,
boolean[] done,
Callback[] selected) |
protected void |
forwardMultiCallInternal(RemoteCallEntry rceIn,
Actor remoteRef,
ConnectionRegistry clientRemoteRegistry,
boolean[] done,
Callback[] selected) |
protected long |
getClientPingTimeout() |
protected long |
getServicePingTimeout() |
protected abstract List<Actor> |
getServices() |
protected void |
handleServiceDiscon(Actor remoteRef) |
void |
hasBeenUnpublished(String connectionIdentifier)
notification method called once an actor has been unpublished.
|
void |
init() |
protected boolean |
isStateful() |
void |
pingServices() |
IPromise<Long> |
router$clientPing(long tim,
long[] publishedActorIds)
a krouter client should ping using this method.
|
abstract void |
router$handleServiceDisconnect(Actor disconnected) |
IPromise |
router$RegisterService(Actor remoteRef,
boolean stateful) |
protected void |
sendFailoverNotification(ConnectionRegistry clientRemoteRegistry) |
protected void |
sendFailoverNotificationInternal(ConnectionRegistry registry) |
__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, zzRoutingRefGCAddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yield, yield, yieldCallbacksclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasBeenPublishedpublic static final String SERVICE_UNAVAILABLE
public static long CLIENT_PING_INTERVAL_MS
protected HashMap<String,ConnectionRegistry> clients
protected long lastSwitch
protected boolean isStateful()
public abstract void router$handleServiceDisconnect(Actor disconnected)
public IPromise<Long> router$clientPing(long tim, long[] publishedActorIds)
Actorrouter$clientPing in class Actor<T extends AbstractKrouter>publishedActorIds - - published actors of senderpublic void init()
public boolean __dispatchRemoteCall(ObjectSocket objSocket, RemoteCallEntry rce, ConnectionRegistry clientRemoteRegistry, List<IPromise> createdFutures, Object authContext, BiFunction<Actor,String,Boolean> callInterceptor, long delayCode)
Actor__dispatchRemoteCall in class Actor<T extends AbstractKrouter>public void pingServices()
public void checkPingOnClients()
protected long getServicePingTimeout()
protected long getClientPingTimeout()
protected void sendFailoverNotification(ConnectionRegistry clientRemoteRegistry)
protected void sendFailoverNotificationInternal(ConnectionRegistry registry)
protected RemoteCallEntry createErrorPromiseResponse(RemoteCallEntry rce, ConnectionRegistry clientRemoteRegistry)
protected void forwardMultiCall(RemoteCallEntry rce, Actor remoteRef, ConnectionRegistry clientRemoteRegistry, boolean[] done, Callback[] selected)
protected void forwardMultiCallInternal(RemoteCallEntry rceIn, Actor remoteRef, ConnectionRegistry clientRemoteRegistry, boolean[] done, Callback[] selected)
protected abstract boolean dispatchRemoteCall(RemoteCallEntry rce, ConnectionRegistry clientRemoteRegistry)
rce - clientRemoteRegistry - protected void forwardCall(RemoteCallEntry rce, Actor remoteRef, ConnectionRegistry clientRemoteRegistry)
protected void forwardCallInternal(RemoteCallEntry rce, Actor remoteRef, ConnectionRegistry clientRemoteRegistry)
protected void handleServiceDiscon(Actor remoteRef)
public void hasBeenUnpublished(String connectionIdentifier)
RemotedActorhasBeenUnpublished in interface RemotedActorpublic void clientConnected(ConnectionRegistry connectionRegistry, String connectionIdentifier)
clientConnected in interface ServingActorpublic void clientDisconnected(ConnectionRegistry connectionRegistry, String connectionIdentifier)
clientDisconnected in interface ServingActorCopyright © 2020. All rights reserved.