Class GrpcRemoteService<D extends com.tangosol.internal.net.grpc.RemoteGrpcServiceDependencies>

  • All Implemented Interfaces:
    com.tangosol.io.ClassLoaderAware, com.tangosol.net.Service, com.tangosol.net.ServiceInfo, com.tangosol.util.Controllable, com.tangosol.util.Service
    Direct Known Subclasses:
    GrpcRemoteCacheService

    public abstract class GrpcRemoteService<D extends com.tangosol.internal.net.grpc.RemoteGrpcServiceDependencies>
    extends Object
    implements com.tangosol.net.Service, com.tangosol.net.ServiceInfo
    A remote service that accesses caches via a remote gRPC proxy.
    Since:
    23.03
    Author:
    Jonathan Knight 2022.08.25
    • Field Detail

      • m_dependencies

        protected D extends com.tangosol.internal.net.grpc.RemoteGrpcServiceDependencies m_dependencies
        The service dependencies.
      • m_sScopeName

        protected String m_sScopeName
        The scope of the service.
      • m_channel

        protected io.grpc.Channel m_channel
        The gRPC Channel used by this session.
      • m_serializer

        protected com.tangosol.io.Serializer m_serializer
        The Serializer used by this session.
      • m_tracingInterceptor

        protected io.grpc.ClientInterceptor m_tracingInterceptor
        The optional client tracer to use.
      • m_EventDispatcherRegistry

        protected com.tangosol.net.events.EventDispatcherRegistry m_EventDispatcherRegistry
        The EventDispatcherRegistry.
      • f_lock

        protected final Lock f_lock
        The lock to synchronize access to internal state
    • Constructor Detail

      • GrpcRemoteService

        public GrpcRemoteService​(String sServiceType)
        Parameters:
        sServiceType - the type of the service
    • Method Detail

      • setCluster

        public void setCluster​(com.tangosol.net.Cluster cluster)
        Set the Cluster.
        Parameters:
        cluster - the Cluster
      • setServiceName

        public void setServiceName​(String sName)
        Set the service name.
        Parameters:
        sName - the service name
      • getChannel

        public io.grpc.Channel getChannel()
        Returns the Channel to use to connect to the server.
        Returns:
        the Channel to use to connect to the server
      • setChannel

        public void setChannel​(io.grpc.Channel channel)
        Set the Channel to use to connect to the server.
        Parameters:
        channel - the Channel to use to connect to the server
      • setTracingInterceptor

        public void setTracingInterceptor​(io.grpc.ClientInterceptor tracingInterceptor)
      • getScopeName

        public String getScopeName()
      • setScopeName

        public void setScopeName​(String sScopeName)
      • getContextClassLoader

        public ClassLoader getContextClassLoader()
        Specified by:
        getContextClassLoader in interface com.tangosol.io.ClassLoaderAware
      • setContextClassLoader

        public void setContextClassLoader​(ClassLoader loader)
        Specified by:
        setContextClassLoader in interface com.tangosol.io.ClassLoaderAware
      • getCluster

        public com.tangosol.net.Cluster getCluster()
        Specified by:
        getCluster in interface com.tangosol.net.Service
      • getInfo

        public com.tangosol.net.ServiceInfo getInfo()
        Specified by:
        getInfo in interface com.tangosol.net.Service
      • addMemberListener

        public void addMemberListener​(com.tangosol.net.MemberListener listener)
        Specified by:
        addMemberListener in interface com.tangosol.net.Service
      • removeMemberListener

        public void removeMemberListener​(com.tangosol.net.MemberListener listener)
        Specified by:
        removeMemberListener in interface com.tangosol.net.Service
      • getUserContext

        public Object getUserContext()
        Specified by:
        getUserContext in interface com.tangosol.net.Service
      • setUserContext

        public void setUserContext​(Object oCtx)
        Specified by:
        setUserContext in interface com.tangosol.net.Service
      • getSerializer

        public com.tangosol.io.Serializer getSerializer()
        Specified by:
        getSerializer in interface com.tangosol.net.Service
      • setSerializer

        protected void setSerializer​(com.tangosol.io.Serializer serializer)
      • setDependencies

        public void setDependencies​(com.tangosol.net.ServiceDependencies deps)
        Specified by:
        setDependencies in interface com.tangosol.net.Service
      • getDependencies

        public D getDependencies()
        Specified by:
        getDependencies in interface com.tangosol.net.Service
      • getResourceRegistry

        public com.tangosol.util.ResourceRegistry getResourceRegistry()
        Specified by:
        getResourceRegistry in interface com.tangosol.net.Service
      • isSuspended

        public boolean isSuspended()
        Specified by:
        isSuspended in interface com.tangosol.net.Service
      • configure

        public void configure​(com.tangosol.run.xml.XmlElement xml)
        Specified by:
        configure in interface com.tangosol.util.Controllable
      • start

        public void start()
        Specified by:
        start in interface com.tangosol.util.Controllable
      • isRunning

        public boolean isRunning()
        Specified by:
        isRunning in interface com.tangosol.util.Controllable
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.tangosol.util.Controllable
      • stop

        public void stop()
        Specified by:
        stop in interface com.tangosol.util.Controllable
      • addServiceListener

        public void addServiceListener​(com.tangosol.util.ServiceListener listener)
        Specified by:
        addServiceListener in interface com.tangosol.util.Service
      • removeServiceListener

        public void removeServiceListener​(com.tangosol.util.ServiceListener listener)
        Specified by:
        removeServiceListener in interface com.tangosol.util.Service
      • getServiceName

        public String getServiceName()
        Specified by:
        getServiceName in interface com.tangosol.net.ServiceInfo
      • getServiceType

        public String getServiceType()
        Specified by:
        getServiceType in interface com.tangosol.net.ServiceInfo
      • getServiceMembers

        public Set getServiceMembers()
        Specified by:
        getServiceMembers in interface com.tangosol.net.ServiceInfo
      • getServiceVersion

        public String getServiceVersion​(com.tangosol.net.Member member)
        Specified by:
        getServiceVersion in interface com.tangosol.net.ServiceInfo
      • getOldestMember

        public com.tangosol.net.Member getOldestMember()
        Specified by:
        getOldestMember in interface com.tangosol.net.ServiceInfo
      • getServiceMember

        public com.tangosol.net.Member getServiceMember​(int nId)
        Specified by:
        getServiceMember in interface com.tangosol.net.ServiceInfo
      • stopInternal

        protected abstract void stopInternal()
        Perform any stop tasks required by subclasses.
      • getEventDispatcherRegistry

        protected com.tangosol.net.events.EventDispatcherRegistry getEventDispatcherRegistry()
      • setEventDispatcherRegistry

        protected void setEventDispatcherRegistry​(com.tangosol.net.events.EventDispatcherRegistry registryInterceptor)
      • getDefaultEventDispatcherRegistry

        protected abstract com.tangosol.net.events.EventDispatcherRegistry getDefaultEventDispatcherRegistry()
        Return the default EventDispatcherRegistry to use.
        Returns:
        the default EventDispatcherRegistry to use
      • instantiateSerializer

        protected com.tangosol.io.Serializer instantiateSerializer​(ClassLoader loader)
        Instantiate a Serializer and optionally configure it with the specified ClassLoader.
        Returns:
        the serializer
      • instantiateChannel

        protected io.grpc.Channel instantiateChannel()
      • instantiateTracingInterceptor

        protected io.grpc.ClientInterceptor instantiateTracingInterceptor()