S - the concrete type of this stub.C - the service descriptor typepublic abstract class AbstractStub<S extends AbstractStub<?,?>,C extends AbstractServiceDescriptor<C>> extends Object
This is the base class of the stub classes from the generated code. It allows for reconfiguration, e.g., attaching interceptors to the stub.
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractStub.StubConfigBuilder
Utility class for (re) configuring the operations in a stub.
|
| Modifier and Type | Field and Description |
|---|---|
protected io.grpc.Channel |
channel |
protected C |
config |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStub(io.grpc.Channel channel,
C config)
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract S |
build(io.grpc.Channel channel,
C config)
Returns a new stub with the given channel for the provided method configurations.
|
AbstractStub.StubConfigBuilder |
configureNewStub()
Creates a builder for reconfiguring the stub.
|
io.grpc.Channel |
getChannel()
The underlying channel of the stub.
|
protected C |
getServiceDescriptor() |
protected final io.grpc.Channel channel
protected final C extends AbstractServiceDescriptor<C> config
protected AbstractStub(io.grpc.Channel channel,
C config)
channel - the channel that this stub will use to do communicationsconfig - defines the RPC methods of the stubprotected C getServiceDescriptor()
public AbstractStub.StubConfigBuilder configureNewStub()
public io.grpc.Channel getChannel()