Class ServiceActor<T extends ServiceActor>

java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<T>
org.nustaq.kontraktor.services.ServiceActor<T>
All Implemented Interfaces:
java.io.Serializable, java.util.concurrent.Executor, org.nustaq.kontraktor.monitoring.Monitorable
Direct Known Subclasses:
DataShard, DynDataShard, PlainService, RLJsonServerService

public abstract class ServiceActor<T extends ServiceActor>
extends org.nustaq.kontraktor.Actor<T>
Created by ruedi on 12.08.2015.
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.nustaq.kontraktor.Actor

    org.nustaq.kontraktor.Actor.ActorReport
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected ServiceArgs cmdline  
    protected ClusterCfg config  
    protected org.nustaq.reallive.server.dynamic.DynClusterDistribution currentDistribution  
    protected DataClient dclient  
    static int DEFAULT_START_TIMEOUT  
    static java.lang.String REGISTRY_DISCONNECTED  
    static java.lang.String REGISTRY_RECONNECTED  
    protected java.util.Map<java.lang.String,​java.lang.Object> requiredServices  
    protected org.nustaq.kontraktor.remoting.base.ServiceDescription serviceDescription  
    protected org.nustaq.kontraktor.remoting.base.ReconnectableRemoteRef<ServiceRegistry> serviceRegistry  
    static java.lang.String UNCONNECTED  

    Fields inherited from class org.nustaq.kontraktor.Actor

    __cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallback

    Fields 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
    ServiceActor()  
  • Method Summary

    Modifier and Type Method Description
    void addServiceEventListener​(java.util.function.BiConsumer<java.lang.String,​java.lang.Object> l)
    runs on client side, receives forwarded service event received from service actor
    protected org.nustaq.kontraktor.IPromise awaitRequiredServices()  
    protected void awaitRequiredServicesInternal​(org.nustaq.kontraktor.Promise p)  
    org.nustaq.kontraktor.IPromise connectRequiredServices()
    try to connect required (unconnected) services, in case of failur UNCONNECTED is put into service hashmap instead
    protected org.nustaq.kontraktor.IPromise<org.nustaq.kontraktor.Actor> connectService​(org.nustaq.kontraktor.remoting.base.ServiceDescription serviceDescription)  
    protected abstract org.nustaq.kontraktor.remoting.base.ServiceDescription createServiceDescription()  
    protected void fireServiceEvent​(java.lang.String ev, java.lang.Object arg)  
    protected java.lang.String[] getAllServiceNames()  
    protected ServiceArgs getCmdline()  
    org.nustaq.kontraktor.IPromise<ClusterCfg> getConfig()  
    org.nustaq.kontraktor.IPromise<DataClient> getDataClient()  
    protected int getPort()  
    protected abstract java.lang.String[] getRequiredServiceNames()  
    protected <T extends org.nustaq.kontraktor.Actor>
    T
    getService​(java.lang.String name)  
    protected org.nustaq.kontraktor.remoting.base.ServiceDescription getServiceDescription()  
    ServiceRegistry getServiceRegistry()  
    protected java.io.Serializable getStatus()  
    protected void gravityDisconnected()  
    void heartBeat()  
    org.nustaq.kontraktor.IPromise init​(org.nustaq.kontraktor.remoting.base.ConnectableActor registryConnectable, ServiceArgs options, boolean autoRegister)  
    protected void initRealLiveDynamic()  
    protected void initRealLiveFixed()  
    protected boolean isDynamicDataCluster()  
    protected boolean isFixedDataCluster()  
    protected void notifyConfigChanged()
    override, config contains updated ClusterCfg
    protected void onRegistryConnected​(boolean autoRegister)  
    protected void onRegistryDisconnected()  
    protected void onServiceRegistryReconnected()  
    protected void publishSelf()  
    protected void registerSelf()
    register at service registry
    void removeServiceEventListener​(java.util.function.BiConsumer<java.lang.String,​java.lang.Object> l)  
    protected void requiredSerivceWentDown​(org.nustaq.kontraktor.remoting.base.ServiceDescription cdr)  
    static ServiceActor RunTCP​(java.lang.String[] args, java.lang.Class<? extends ServiceActor> serviceClazz, java.lang.Class<? extends ServiceArgs> argsClazz)  
    static ServiceActor RunTCP​(java.lang.String[] args, java.lang.Class<? extends ServiceActor> serviceClazz, java.lang.Class<? extends ServiceArgs> argsClazz, long timeout)  
    static ServiceActor RunTCP​(java.lang.String[] args, java.lang.Class<? extends ServiceActor> serviceClazz, java.lang.Class<? extends ServiceArgs> argsClazz, java.lang.Class<? extends ServiceRegistry> serviceRegistryClass)  
    static ServiceActor RunTCP​(java.lang.String[] args, java.lang.Class<? extends ServiceActor> serviceClazz, java.lang.Class<? extends ServiceArgs> argsClazz, java.lang.Class<? extends ServiceRegistry> serviceRegistryClass, long timeout)
    run & connect a service with given cmdline args and classes
    static ServiceActor RunTCP​(ServiceArgs options, java.lang.Class<? extends ServiceActor> serviceClazz, long timeout)  
    static ServiceActor RunTCP​(ServiceArgs options, java.lang.Class<? extends ServiceActor> serviceClazz, java.lang.Class<? extends ServiceRegistry> serviceRegistryClass, long timeout)  
    protected void serviceDisconnected​(org.nustaq.kontraktor.Actor act)  
    protected void serviceEvent​(java.lang.String eventId, java.lang.Object cdr, java.lang.Object err)  

    Methods inherited from class org.nustaq.kontraktor.Actor

    __addDeadLetter, __addRemoteConnection, __addStopHandler, __dispatchRemoteCall, __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, router$clientPing, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGC

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait