Package com.oracle.coherence.client
Class BaseGrpcClient.DefaultDependencies
- java.lang.Object
-
- com.oracle.coherence.client.BaseGrpcClient.DefaultDependencies
-
- All Implemented Interfaces:
BaseGrpcClient.Dependencies
- Direct Known Subclasses:
AsyncNamedCacheClient.DefaultDependencies
- Enclosing class:
- BaseGrpcClient<V>
public static class BaseGrpcClient.DefaultDependencies extends Object implements BaseGrpcClient.Dependencies
The default dependencies implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultDependencies(String sName, io.grpc.Channel channel, com.tangosol.net.events.EventDispatcher dispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.ChannelgetChannel()Returns the gRPCChannel.longgetDeadline()Obtain a default rpc deadline value.com.tangosol.net.events.EventDispatchergetEventDispatcher()Returns the event dispatcher for the resource.Optional<Executor>getExecutor()Return the optionalExecutorto use.StringgetName()Return the underlying resource name.Optional<String>getScopeName()Returns the scope named used to link requests to a specific server side scope.Optional<com.tangosol.io.Serializer>getSerializer()Return theSerializerto use to serialize request and response payloads.Optional<String>getSerializerFormat()Return the name of the serialization format to be used for requests and responses.voidsetDeadline(long cMillis)Set the rpc deadline to use.voidsetExecutor(Executor executor)Set the optionalExecutorto use instead of aSimpleDaemonPoolExecutor.voidsetScope(String sScopeName)Set the scope name.voidsetSerializer(com.tangosol.io.Serializer serializer)Set theSerializerto use for requests and response payloads.voidsetSerializer(com.tangosol.io.Serializer serializer, String sFormat)Set theSerializerand serialization format name to use for requests and response payloads.voidsetSerializerFormat(String sFormat)Set the serialization format to use for requests and responses.
-
-
-
Constructor Detail
-
DefaultDependencies
public DefaultDependencies(String sName, io.grpc.Channel channel, com.tangosol.net.events.EventDispatcher dispatcher)
- Parameters:
channel- the gRPCChannelto usedispatcher- theEventDispatcherto use for lifecycle events
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:BaseGrpcClient.DependenciesReturn the underlying resource name.- Specified by:
getNamein interfaceBaseGrpcClient.Dependencies- Returns:
- the underlying resource name
-
getChannel
public io.grpc.Channel getChannel()
Description copied from interface:BaseGrpcClient.DependenciesReturns the gRPCChannel.This method must not return
null.- Specified by:
getChannelin interfaceBaseGrpcClient.Dependencies- Returns:
- the gRPC
Channel
-
getScopeName
public Optional<String> getScopeName()
Description copied from interface:BaseGrpcClient.DependenciesReturns the scope named used to link requests to a specific server side scope.- Specified by:
getScopeNamein interfaceBaseGrpcClient.Dependencies- Returns:
- the scope named used to for requests
-
getSerializer
public Optional<com.tangosol.io.Serializer> getSerializer()
Description copied from interface:BaseGrpcClient.DependenciesReturn theSerializerto use to serialize request and response payloads.- Specified by:
getSerializerin interfaceBaseGrpcClient.Dependencies- Returns:
- the
Serializerto use for request and response payloads
-
getSerializerFormat
public Optional<String> getSerializerFormat()
Description copied from interface:BaseGrpcClient.DependenciesReturn the name of the serialization format to be used for requests and responses.- Specified by:
getSerializerFormatin interfaceBaseGrpcClient.Dependencies- Returns:
- the name of the serialization format to be used for requests and responses
-
getExecutor
public Optional<Executor> getExecutor()
Description copied from interface:BaseGrpcClient.DependenciesReturn the optionalExecutorto use.- Specified by:
getExecutorin interfaceBaseGrpcClient.Dependencies- Returns:
- the optional
Executorto use
-
getEventDispatcher
public com.tangosol.net.events.EventDispatcher getEventDispatcher()
Description copied from interface:BaseGrpcClient.DependenciesReturns the event dispatcher for the resource.- Specified by:
getEventDispatcherin interfaceBaseGrpcClient.Dependencies- Returns:
- the event dispatcher for the resource
-
getDeadline
public long getDeadline()
Description copied from interface:BaseGrpcClient.DependenciesObtain a default rpc deadline value. If set to a value less than or equal to zero, a value of 30 seconds is used.- Specified by:
getDeadlinein interfaceBaseGrpcClient.Dependencies- Returns:
- the default request timeout
-
setScope
public void setScope(String sScopeName)
Set the scope name.- Parameters:
sScopeName- the scope name
-
setExecutor
public void setExecutor(Executor executor)
Set the optionalExecutorto use instead of aSimpleDaemonPoolExecutor.- Parameters:
executor- the optionalExecutorto use
-
setSerializerFormat
public void setSerializerFormat(String sFormat)
Set the serialization format to use for requests and responses.Calling this method will remove any
Serializerset by callingsetSerializer(Serializer)orsetSerializer(Serializer, String).A
Serializerconfiguration with the specified name must exist in the Coherence Operational Configuration.- Parameters:
sFormat- the serialization format and reference to aSerializerconfiguration in the Coherence Operational Configuration
-
setSerializer
public void setSerializer(com.tangosol.io.Serializer serializer)
Set theSerializerto use for requests and response payloads.The serialization format used will be obtained by calling the
Serializer.getName()method on the serializer.- Parameters:
serializer- theSerializerto use to serialize request and response payloads
-
setSerializer
public void setSerializer(com.tangosol.io.Serializer serializer, String sFormat)Set theSerializerand serialization format name to use for requests and response payloads.- Parameters:
serializer- theSerializerto use to serialize request and response payloadssFormat- the serialization format name
-
setDeadline
public void setDeadline(long cMillis)
Set the rpc deadline to use.- Parameters:
cMillis- rpc deadline
-
-