Package com.oracle.coherence.client
Class GrpcChannelFactory
- java.lang.Object
-
- io.grpc.NameResolver.Factory
-
- io.grpc.NameResolverProvider
-
- com.oracle.coherence.client.GrpcChannelFactory
-
public class GrpcChannelFactory extends io.grpc.NameResolverProviderA default implementation ofGrpcChannelFactory.- Since:
- 22.06.2
- Author:
- Jonathan Knight 2022.08.25
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGrpcChannelFactory.AddressProviderNameResolverA custom gRPCNameResolver.static classGrpcChannelFactory.GrpcServiceInfoA holder for gRPC service information.protected static classGrpcChannelFactory.NullNameResolverListenerA no-op implementation of aNameResolver.Listener2.protected static classGrpcChannelFactory.ResolveARunnablethat will actually resolve the gRPC endpoints.
-
Field Summary
Fields Modifier and Type Field Description static StringRESOLVER_SCHEMEThe name of the custom Coherence gRPC name resolver.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.ChannelgetChannel(GrpcRemoteService<?> service)Create aChannel.StringgetDefaultScheme()protected booleanisAvailable()io.grpc.NameResolvernewNameResolver(URI targetUri, io.grpc.NameResolver.Args args)protected intpriority()static GrpcChannelFactorysingleton()Returns the singleton instance ofGrpcChannelFactory.
-
-
-
Field Detail
-
RESOLVER_SCHEME
public static final String RESOLVER_SCHEME
The name of the custom Coherence gRPC name resolver.- See Also:
- Constant Field Values
-
-
Method Detail
-
singleton
public static GrpcChannelFactory singleton()
Returns the singleton instance ofGrpcChannelFactory.- Returns:
- the singleton instance of
GrpcChannelFactory
-
getChannel
public io.grpc.Channel getChannel(GrpcRemoteService<?> service)
Create aChannel.- Parameters:
service- theGrpcRemoteCacheServiceto create the channel for- Returns:
- a
Channel
-
newNameResolver
public io.grpc.NameResolver newNameResolver(URI targetUri, io.grpc.NameResolver.Args args)
- Specified by:
newNameResolverin classio.grpc.NameResolver.Factory
-
getDefaultScheme
public String getDefaultScheme()
- Specified by:
getDefaultSchemein classio.grpc.NameResolver.Factory
-
isAvailable
protected boolean isAvailable()
- Specified by:
isAvailablein classio.grpc.NameResolverProvider
-
priority
protected int priority()
- Specified by:
priorityin classio.grpc.NameResolverProvider
-
-