@ExperimentalApi public abstract class TransportManager<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TransportManager.InterimTransport<T>
A transport provided as a temporary holder of new requests, which will be eventually
transferred to real transports or fail.
|
Constructor and Description |
---|
TransportManager() |
Modifier and Type | Method and Description |
---|---|
abstract T |
createFailingTransport(Status error)
Creates a transport that would fail all RPCs with the given error.
|
abstract TransportManager.InterimTransport<T> |
createInterimTransport()
Returns a transport that is not associated with any address.
|
abstract T |
getTransport(EquivalentAddressGroup addressGroup)
Returns a transport for any of the addresses from the given address group.
|
abstract Channel |
makeChannel(T transport)
Returns a channel that uses
transport ; useful for issuing RPCs on a transport. |
abstract void |
updateRetainedTransports(Collection<EquivalentAddressGroup> addrs)
Advises this
TransportManager to retain transports only to these servers, for warming
up connections and discarding unused connections. |
public abstract void updateRetainedTransports(Collection<EquivalentAddressGroup> addrs)
TransportManager
to retain transports only to these servers, for warming
up connections and discarding unused connections.public abstract T getTransport(EquivalentAddressGroup addressGroup)
Never returns null
public abstract T createFailingTransport(Status error)
public abstract TransportManager.InterimTransport<T> createInterimTransport()
This method is typically used in lieu of getTransport(io.grpc.EquivalentAddressGroup)
before server addresses are
known.
The returned interim transport is tracked by this TransportManager
. You must call
TransportManager.InterimTransport.closeWithRealTransports(com.google.common.base.Supplier<T>)
or TransportManager.InterimTransport.closeWithError(io.grpc.Status)
when it's no longer used, so that TransportManager
can get rid of it.