Package io.grpc.stub
Class AbstractBlockingStub<S extends AbstractBlockingStub<S>>
- java.lang.Object
-
- io.grpc.stub.AbstractStub<S>
-
- io.grpc.stub.AbstractBlockingStub<S>
-
- Direct Known Subclasses:
ChannelzGrpc.ChannelzBlockingStub
,HealthGrpc.HealthBlockingStub
,LoadBalancerGrpc.LoadBalancerBlockingStub
,ServerReflectionGrpc.ServerReflectionBlockingStub
,ServerReflectionGrpc.ServerReflectionBlockingStub
@ThreadSafe @CheckReturnValue public abstract class AbstractBlockingStub<S extends AbstractBlockingStub<S>> extends AbstractStub<S>
Stub implementations for blocking stubs.DO NOT MOCK: Customizing options doesn't work properly in mocks. Use InProcessChannelBuilder to create a real channel suitable for testing. It is also possible to mock Channel instead.
- Since:
- 1.26.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.stub.AbstractStub
AbstractStub.StubFactory<T extends AbstractStub<T>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBlockingStub(Channel channel, CallOptions callOptions)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends AbstractStub<T>>
TnewStub(AbstractStub.StubFactory<T> factory, Channel channel)
Returns a new blocking stub with the given channel for the provided method configurations.static <T extends AbstractStub<T>>
TnewStub(AbstractStub.StubFactory<T> factory, Channel channel, CallOptions callOptions)
Returns a new blocking stub with the given channel for the provided method configurations.-
Methods inherited from class io.grpc.stub.AbstractStub
build, getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOnReadyThreshold, withOption, withWaitForReady
-
-
-
-
Constructor Detail
-
AbstractBlockingStub
protected AbstractBlockingStub(Channel channel, CallOptions callOptions)
-
-
Method Detail
-
newStub
public static <T extends AbstractStub<T>> T newStub(AbstractStub.StubFactory<T> factory, Channel channel)
Returns a new blocking stub with the given channel for the provided method configurations.- Parameters:
factory
- the factory to create a blocking stubchannel
- the channel that this stub will use to do communications- Since:
- 1.26.0
-
newStub
public static <T extends AbstractStub<T>> T newStub(AbstractStub.StubFactory<T> factory, Channel channel, CallOptions callOptions)
Returns a new blocking stub with the given channel for the provided method configurations.- Parameters:
factory
- the factory to create a blocking stubchannel
- the channel that this stub will use to do communicationscallOptions
- the runtime call options to be applied to every call on this stub- Since:
- 1.26.0
-
-