Package com.oracle.coherence.client
Class GrpcRemoteService<D extends com.tangosol.internal.net.grpc.RemoteGrpcServiceDependencies>
- java.lang.Object
-
- com.oracle.coherence.client.GrpcRemoteService<D>
-
- 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 Summary
Fields Modifier and Type Field Description protected Lockf_lockThe lock to synchronize access to internal stateprotected io.grpc.Channelm_channelThe gRPCChannelused by this session.protected Dm_dependenciesThe service dependencies.protected com.tangosol.net.events.EventDispatcherRegistrym_EventDispatcherRegistryTheEventDispatcherRegistry.protected SimpleDaemonPoolExecutorm_executorTheExecutorto use to dispatch events.protected com.tangosol.io.Serializerm_serializerTheSerializerused by this session.protected Stringm_sScopeNameThe scope of the service.protected io.grpc.ClientInterceptorm_tracingInterceptorThe optional client tracer to use.
-
Constructor Summary
Constructors Constructor Description GrpcRemoteService(String sServiceType)Create aGrpcRemoteService.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddMemberListener(com.tangosol.net.MemberListener listener)voidaddServiceListener(com.tangosol.util.ServiceListener listener)voidconfigure(com.tangosol.run.xml.XmlElement xml)io.grpc.ChannelgetChannel()Returns theChannelto use to connect to the server.com.tangosol.net.ClustergetCluster()ClassLoadergetContextClassLoader()protected abstract com.tangosol.net.events.EventDispatcherRegistrygetDefaultEventDispatcherRegistry()Return the defaultEventDispatcherRegistryto use.DgetDependencies()protected com.tangosol.net.events.EventDispatcherRegistrygetEventDispatcherRegistry()SimpleDaemonPoolExecutorgetExecutor()com.tangosol.net.ServiceInfogetInfo()com.tangosol.net.MembergetOldestMember()com.tangosol.util.ResourceRegistrygetResourceRegistry()StringgetScopeName()com.tangosol.io.SerializergetSerializer()com.tangosol.net.MembergetServiceMember(int nId)SetgetServiceMembers()StringgetServiceName()StringgetServiceType()StringgetServiceVersion(com.tangosol.net.Member member)ObjectgetUserContext()protected io.grpc.ChannelinstantiateChannel()protected SimpleDaemonPoolExecutorinstantiateExecutor()protected com.tangosol.io.SerializerinstantiateSerializer(ClassLoader loader)Instantiate a Serializer and optionally configure it with the specified ClassLoader.protected io.grpc.ClientInterceptorinstantiateTracingInterceptor()booleanisRunning()booleanisSuspended()voidremoveMemberListener(com.tangosol.net.MemberListener listener)voidremoveServiceListener(com.tangosol.util.ServiceListener listener)voidsetChannel(io.grpc.Channel channel)Set theChannelto use to connect to the server.voidsetCluster(com.tangosol.net.Cluster cluster)Set theCluster.voidsetContextClassLoader(ClassLoader loader)voidsetDependencies(com.tangosol.net.ServiceDependencies deps)protected voidsetEventDispatcherRegistry(com.tangosol.net.events.EventDispatcherRegistry registryInterceptor)voidsetExecutor(SimpleDaemonPoolExecutor executor)voidsetScopeName(String sScopeName)protected voidsetSerializer(com.tangosol.io.Serializer serializer)voidsetServiceName(String sName)Set the service name.voidsetTracingInterceptor(io.grpc.ClientInterceptor tracingInterceptor)voidsetUserContext(Object oCtx)voidshutdown()voidstart()voidstop()protected abstract voidstopInternal()Perform any stop tasks required by subclasses.
-
-
-
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 gRPCChannelused by this session.
-
m_serializer
protected com.tangosol.io.Serializer m_serializer
TheSerializerused by this session.
-
m_tracingInterceptor
protected io.grpc.ClientInterceptor m_tracingInterceptor
The optional client tracer to use.
-
m_executor
protected SimpleDaemonPoolExecutor m_executor
TheExecutorto use to dispatch events.
-
m_EventDispatcherRegistry
protected com.tangosol.net.events.EventDispatcherRegistry m_EventDispatcherRegistry
TheEventDispatcherRegistry.
-
f_lock
protected final Lock f_lock
The lock to synchronize access to internal state
-
-
Constructor Detail
-
GrpcRemoteService
public GrpcRemoteService(String sServiceType)
Create aGrpcRemoteService.- Parameters:
sServiceType- the type of the service
-
-
Method Detail
-
setCluster
public void setCluster(com.tangosol.net.Cluster cluster)
Set theCluster.- Parameters:
cluster- theCluster
-
setServiceName
public void setServiceName(String sName)
Set the service name.- Parameters:
sName- the service name
-
getChannel
public io.grpc.Channel getChannel()
Returns theChannelto use to connect to the server.- Returns:
- the
Channelto use to connect to the server
-
setChannel
public void setChannel(io.grpc.Channel channel)
Set theChannelto use to connect to the server.- Parameters:
channel- theChannelto use to connect to the server
-
setTracingInterceptor
public void setTracingInterceptor(io.grpc.ClientInterceptor tracingInterceptor)
-
getExecutor
public SimpleDaemonPoolExecutor getExecutor()
-
setExecutor
public void setExecutor(SimpleDaemonPoolExecutor executor)
-
getScopeName
public String getScopeName()
-
setScopeName
public void setScopeName(String sScopeName)
-
getContextClassLoader
public ClassLoader getContextClassLoader()
- Specified by:
getContextClassLoaderin interfacecom.tangosol.io.ClassLoaderAware
-
setContextClassLoader
public void setContextClassLoader(ClassLoader loader)
- Specified by:
setContextClassLoaderin interfacecom.tangosol.io.ClassLoaderAware
-
getCluster
public com.tangosol.net.Cluster getCluster()
- Specified by:
getClusterin interfacecom.tangosol.net.Service
-
getInfo
public com.tangosol.net.ServiceInfo getInfo()
- Specified by:
getInfoin interfacecom.tangosol.net.Service
-
addMemberListener
public void addMemberListener(com.tangosol.net.MemberListener listener)
- Specified by:
addMemberListenerin interfacecom.tangosol.net.Service
-
removeMemberListener
public void removeMemberListener(com.tangosol.net.MemberListener listener)
- Specified by:
removeMemberListenerin interfacecom.tangosol.net.Service
-
getUserContext
public Object getUserContext()
- Specified by:
getUserContextin interfacecom.tangosol.net.Service
-
setUserContext
public void setUserContext(Object oCtx)
- Specified by:
setUserContextin interfacecom.tangosol.net.Service
-
getSerializer
public com.tangosol.io.Serializer getSerializer()
- Specified by:
getSerializerin interfacecom.tangosol.net.Service
-
setSerializer
protected void setSerializer(com.tangosol.io.Serializer serializer)
-
setDependencies
public void setDependencies(com.tangosol.net.ServiceDependencies deps)
- Specified by:
setDependenciesin interfacecom.tangosol.net.Service
-
getDependencies
public D getDependencies()
- Specified by:
getDependenciesin interfacecom.tangosol.net.Service
-
getResourceRegistry
public com.tangosol.util.ResourceRegistry getResourceRegistry()
- Specified by:
getResourceRegistryin interfacecom.tangosol.net.Service
-
isSuspended
public boolean isSuspended()
- Specified by:
isSuspendedin interfacecom.tangosol.net.Service
-
configure
public void configure(com.tangosol.run.xml.XmlElement xml)
- Specified by:
configurein interfacecom.tangosol.util.Controllable
-
start
public void start()
- Specified by:
startin interfacecom.tangosol.util.Controllable
-
isRunning
public boolean isRunning()
- Specified by:
isRunningin interfacecom.tangosol.util.Controllable
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacecom.tangosol.util.Controllable
-
stop
public void stop()
- Specified by:
stopin interfacecom.tangosol.util.Controllable
-
addServiceListener
public void addServiceListener(com.tangosol.util.ServiceListener listener)
- Specified by:
addServiceListenerin interfacecom.tangosol.util.Service
-
removeServiceListener
public void removeServiceListener(com.tangosol.util.ServiceListener listener)
- Specified by:
removeServiceListenerin interfacecom.tangosol.util.Service
-
getServiceName
public String getServiceName()
- Specified by:
getServiceNamein interfacecom.tangosol.net.ServiceInfo
-
getServiceType
public String getServiceType()
- Specified by:
getServiceTypein interfacecom.tangosol.net.ServiceInfo
-
getServiceMembers
public Set getServiceMembers()
- Specified by:
getServiceMembersin interfacecom.tangosol.net.ServiceInfo
-
getServiceVersion
public String getServiceVersion(com.tangosol.net.Member member)
- Specified by:
getServiceVersionin interfacecom.tangosol.net.ServiceInfo
-
getOldestMember
public com.tangosol.net.Member getOldestMember()
- Specified by:
getOldestMemberin interfacecom.tangosol.net.ServiceInfo
-
getServiceMember
public com.tangosol.net.Member getServiceMember(int nId)
- Specified by:
getServiceMemberin interfacecom.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 defaultEventDispatcherRegistryto use.- Returns:
- the default
EventDispatcherRegistryto 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()
-
instantiateExecutor
protected SimpleDaemonPoolExecutor instantiateExecutor()
-
-