Class ClientConfig
java.lang.Object
org.glassfish.jersey.client.ClientConfig
- All Implemented Interfaces:
javax.ws.rs.core.Configurable<ClientConfig>, javax.ws.rs.core.Configuration, ExtendedConfig
public class ClientConfig
extends Object
implements javax.ws.rs.core.Configurable<ClientConfig>, ExtendedConfig
Jersey externalized implementation of client-side JAX-RS
configurable contract.- Author:
- Marek Potociar (marek.potociar at oracle.com), Martin Matula, Libor Kramolis (libor.kramolis at oracle.com)
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new Jersey configuration instance with the default features and property values.ClientConfig(Class<?>... providerClasses) Construct a new Jersey configuration instance and register the provided list of provider classes.ClientConfig(Object... providers) Construct a new Jersey configuration instance and register the provided list of provider instances. -
Method Summary
Modifier and TypeMethodDescriptionconnectorProvider(ConnectorProvider connectorProvider) Register a custom Jersey client connector provider.booleanexecutorService(ExecutorService executorService) Register custom Jersey client async executor.Get the parent Jersey client this configuration is bound to.Get the client transport connector.Get the client transport connector provider.getContracts(Class<?> componentClass) Get custom client executor service.getProperty(String name) javax.ws.rs.RuntimeTypeGet custom client scheduled executor service.inthashCode()booleanbooleanisEnabled(javax.ws.rs.core.Feature feature) booleanisProperty(String name) Get the value of the property with a given name converted toboolean.booleanisRegistered(Class<?> componentClass) booleanisRegistered(Object component) loadFrom(javax.ws.rs.core.Configuration config) Load the internal configuration state from an externally provided configuration state.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) Register custom Jersey client scheduler.
-
Constructor Details
-
ClientConfig
public ClientConfig()Construct a new Jersey configuration instance with the default features and property values. -
ClientConfig
Construct a new Jersey configuration instance and register the provided list of provider classes.- Parameters:
providerClasses- provider classes to be registered with this client configuration.
-
ClientConfig
Construct a new Jersey configuration instance and register the provided list of provider instances.- Parameters:
providers- provider instances to be registered with this client configuration.
-
-
Method Details
-
loadFrom
Load the internal configuration state from an externally provided configuration state.Calling this method effectively replaces existing configuration state of the instance with the state represented by the externally provided configuration.
- Parameters:
config- external configuration state to replace the configuration of this configurable instance.- Returns:
- the updated client configuration instance.
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
register
- Specified by:
registerin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
property
- Specified by:
propertyin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
getConfiguration
- Specified by:
getConfigurationin interfacejavax.ws.rs.core.Configurable<ClientConfig>
-
getRuntimeType
public javax.ws.rs.RuntimeType getRuntimeType()- Specified by:
getRuntimeTypein interfacejavax.ws.rs.core.Configuration
-
getProperties
-
getProperty
-
getPropertyNames
- Specified by:
getPropertyNamesin interfacejavax.ws.rs.core.Configuration
-
isProperty
Description copied from interface:ExtendedConfigGet the value of the property with a given name converted toboolean. Returnsfalseif the value is not convertible.- Specified by:
isPropertyin interfaceExtendedConfig- Parameters:
name- property name.- Returns:
booleanproperty value orfalseif the property is not convertible.
-
isEnabled
public boolean isEnabled(javax.ws.rs.core.Feature feature) - Specified by:
isEnabledin interfacejavax.ws.rs.core.Configuration
-
isEnabled
- Specified by:
isEnabledin interfacejavax.ws.rs.core.Configuration
-
isRegistered
- Specified by:
isRegisteredin interfacejavax.ws.rs.core.Configuration
-
getContracts
-
isRegistered
- Specified by:
isRegisteredin interfacejavax.ws.rs.core.Configuration
-
getClasses
-
getInstances
-
connectorProvider
Register a custom Jersey client connector provider.The registered
ConnectorProviderinstance will provide a Jersey clientConnectorfor theJerseyClientinstance created with this client configuration.- Parameters:
connectorProvider- custom connector provider. Must not benull.- Returns:
- this client config instance.
- Throws:
NullPointerException- in case theconnectorProviderisnull.- Since:
- 2.5
-
executorService
Register custom Jersey client async executor.- Parameters:
executorService- custom executor service instance- Returns:
- this client config instance
-
scheduledExecutorService
Register custom Jersey client scheduler.- Parameters:
scheduledExecutorService- custom scheduled executor service instance- Returns:
- this client config instance
-
getConnector
Get the client transport connector.May return
nullif no connector has been set.- Returns:
- client transport connector or {code null} if not set.
-
getConnectorProvider
Get the client transport connector provider.If no custom connector provider has been set,
default connector providerinstance is returned.- Returns:
- configured client transport connector provider.
- Since:
- 2.5
-
getExecutorService
Get custom client executor service.May return null if no custom executor service has been set.
- Returns:
- custom executor service instance or
nullif not set. - Since:
- 2.26
-
getScheduledExecutorService
Get custom client scheduled executor service.May return null if no custom scheduled executor service has been set.
- Returns:
- custom executor service instance or
nullif not set. - Since:
- 2.26
-
getClientExecutor
-
getClient
Get the parent Jersey client this configuration is bound to.May return
nullif no parent client has been bound.- Returns:
- bound parent Jersey client or
nullif not bound.
-
equals
-
hashCode
-