Class AbstractAsyncStub<S extends AbstractAsyncStub<S>>
java.lang.Object
io.grpc.stub.AbstractStub<S>
io.grpc.stub.AbstractAsyncStub<S>
- Direct Known Subclasses:
ChannelzGrpc.ChannelzStub, HealthGrpc.HealthStub, LoadBalancerGrpc.LoadBalancerStub, RouteLookupServiceGrpc.RouteLookupServiceStub, ServerReflectionGrpc.ServerReflectionStub, ServerReflectionGrpc.ServerReflectionStub
@ThreadSafe
@CheckReturnValue
public abstract class AbstractAsyncStub<S extends AbstractAsyncStub<S>>
extends AbstractStub<S>
Stub implementations for async 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 AbstractStub
AbstractStub.StubFactory<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAsyncStub(Channel channel, CallOptions callOptions) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends AbstractStub<T>>
TnewStub(AbstractStub.StubFactory<T> factory, Channel channel) Returns a new async 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 async stub with the given channel for the provided method configurations.
-
Constructor Details
-
AbstractAsyncStub
-
-
Method Details
-
newStub
public static <T extends AbstractStub<T>> T newStub(AbstractStub.StubFactory<T> factory, Channel channel) Returns a new async stub with the given channel for the provided method configurations.- Parameters:
factory- the factory to create an async 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 async stub with the given channel for the provided method configurations.- Parameters:
factory- the factory to create an async 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
-