@BetaApi public class FixedContextTransportProvider extends Object implements TransportProvider
| Modifier and Type | Method and Description |
|---|---|
static FixedContextTransportProvider |
create(Transport transport) |
Transport |
getTransport()
Provides a Transport, which could either be a new instance for every call, or the same
instance, depending on the implementation.
|
Transport |
getTransport(ScheduledExecutorService executor)
Provides a Transport, which could either be a new instance for every call, or the same
instance, depending on the implementation.
|
String |
getTransportName()
The name of the transport.
|
boolean |
needsExecutor()
True if the Transport needs an executor.
|
public boolean needsExecutor()
TransportProviderneedsExecutor in interface TransportProviderpublic Transport getTransport() throws IOException
TransportProviderThis method should only be called if TransportProvider.needsExecutor() returns false.
getTransport in interface TransportProviderIOExceptionpublic Transport getTransport(ScheduledExecutorService executor) throws IOException
TransportProviderThis method should only be called if TransportProvider.needsExecutor() returns true.
getTransport in interface TransportProviderIOExceptionpublic String getTransportName()
TransportProviderThis string can be used for identifying transports for switching logic.
getTransportName in interface TransportProviderpublic static FixedContextTransportProvider create(Transport transport)