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
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) Get custom client scheduled executor service.inthashCode()booleanbooleanbooleanisProperty(String name) Get the value of the property with a given name converted toboolean.booleanisRegistered(Class<?> componentClass) booleanisRegistered(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, waitMethods 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:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
register
- Specified by:
registerin interfaceConfigurable<ClientConfig>
-
property
- Specified by:
propertyin interfaceConfigurable<ClientConfig>
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<ClientConfig>
-
getRuntimeType
- Specified by:
getRuntimeTypein interfaceConfiguration
-
getProperties
- Specified by:
getPropertiesin interfaceConfiguration
-
getProperty
- Specified by:
getPropertyin interfaceConfiguration
-
getPropertyNames
- Specified by:
getPropertyNamesin interfaceConfiguration
-
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
- Specified by:
isEnabledin interfaceConfiguration
-
isEnabled
- Specified by:
isEnabledin interfaceConfiguration
-
isRegistered
- Specified by:
isRegisteredin interfaceConfiguration
-
getContracts
- Specified by:
getContractsin interfaceConfiguration
-
isRegistered
- Specified by:
isRegisteredin interfaceConfiguration
-
getClasses
- Specified by:
getClassesin interfaceConfiguration
-
getInstances
- Specified by:
getInstancesin interfaceConfiguration
-
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
public int hashCode()
-