Interface ConnectorProvider
-
- All Known Implementing Classes:
CachingConnectorProvider,HttpUrlConnectorProvider
public interface ConnectorProviderJersey client connector provider contract. Connector provider is invoked by Jersey client runtime to provide a client connector to be used to send client requests over the wire to server-side resources. There can be only one connector provider registered in a single Jersey client instance.Note that unlike most of the other
Jersey SPI extension contracts,ConnectorProvideris not a typical runtime extension and as such cannot be registered using a configurationregister(...)method. Instead, it must be registered using viaJerseyClientBuilderusing it'sClientConfig.connectorProvider(ConnectorProvider)initializer method.- Since:
- 2.5
- Author:
- Marek Potociar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectorgetConnector(Client client, Configuration runtimeConfig)Get a Jersey client connector instance for a givenclientinstance and Jersey client runtimeconfiguration.
-
-
-
Method Detail
-
getConnector
Connector getConnector(Client client, Configuration runtimeConfig)
Get a Jersey client connector instance for a givenclientinstance and Jersey client runtimeconfiguration.Note that the supplied runtime configuration can be different from the client instance configuration as a single client can be used to serve multiple differently configured runtimes. While the
SSL contextorhostname verifierare shared, other configuration properties may change in each runtime.Based on the supplied client and runtime configuration data, it is up to each connector provider implementation to decide whether a new dedicated connector instance is required or if the existing, previously create connector instance can be reused.
- Parameters:
client- Jersey client instance.runtimeConfig- Jersey client runtime configuration.- Returns:
- configured
Connectorinstance to be used by the client.
-
-