Package org.glassfish.jersey.client
Class ClientConfig
java.lang.Object
org.glassfish.jersey.client.ClientConfig
- All Implemented Interfaces:
Configurable<ClientConfig>
,Configuration
,ExtendedConfig
Jersey externalized implementation of client-side JAX-RS
configurable
contract.- Author:
- Marek Potociar, Martin Matula, Libor Kramolis, Gaurav Gupta (gaurav.gupta@payara.fish)
-
Constructor Summary
ConstructorDescriptionConstruct 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.boolean
executorService
(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) Get custom client scheduled executor service.int
hashCode()
boolean
boolean
boolean
isProperty
(String name) Get the value of the property with a given name converted toboolean
.boolean
isRegistered
(Class<?> componentClass) boolean
isRegistered
(Object component) loadFrom
(Configuration config) Load the internal configuration state from an externally provided configuration state.scheduledExecutorService
(ScheduledExecutorService scheduledExecutorService) Register custom Jersey client scheduler.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.ws.rs.core.Configuration
hasProperty
-
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:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
register
- Specified by:
register
in interfaceConfigurable<ClientConfig>
-
property
- Specified by:
property
in interfaceConfigurable<ClientConfig>
-
getConfiguration
- Specified by:
getConfiguration
in interfaceConfigurable<ClientConfig>
-
getRuntimeType
- Specified by:
getRuntimeType
in interfaceConfiguration
-
getProperties
- Specified by:
getProperties
in interfaceConfiguration
-
getProperty
- Specified by:
getProperty
in interfaceConfiguration
-
getPropertyNames
- Specified by:
getPropertyNames
in interfaceConfiguration
-
isProperty
Description copied from interface:ExtendedConfig
Get the value of the property with a given name converted toboolean
. Returnsfalse
if the value is not convertible.- Specified by:
isProperty
in interfaceExtendedConfig
- Parameters:
name
- property name.- Returns:
boolean
property value orfalse
if the property is not convertible.
-
isEnabled
- Specified by:
isEnabled
in interfaceConfiguration
-
isEnabled
- Specified by:
isEnabled
in interfaceConfiguration
-
isRegistered
- Specified by:
isRegistered
in interfaceConfiguration
-
getContracts
- Specified by:
getContracts
in interfaceConfiguration
-
isRegistered
- Specified by:
isRegistered
in interfaceConfiguration
-
getClasses
- Specified by:
getClasses
in interfaceConfiguration
-
getInstances
- Specified by:
getInstances
in interfaceConfiguration
-
connectorProvider
Register a custom Jersey client connector provider.The registered
ConnectorProvider
instance will provide a Jersey clientConnector
for theJerseyClient
instance created with this client configuration.- Parameters:
connectorProvider
- custom connector provider. Must not benull
.- Returns:
- this client config instance.
- Throws:
NullPointerException
- in case theconnectorProvider
isnull
.- 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
null
if 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 provider
instance 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
null
if 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
null
if not set. - Since:
- 2.26
-
getClientExecutor
-
getClient
Get the parent Jersey client this configuration is bound to.May return
null
if no parent client has been bound.- Returns:
- bound parent Jersey client or
null
if not bound.
-
equals
-
hashCode
public int hashCode()
-