public class ClientConfig extends Object implements Configurable<ClientConfig>, ExtendedConfig
configurable
contract.Constructor and Description |
---|
ClientConfig()
Construct 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.
|
Modifier and Type | Method and Description |
---|---|
ClientConfig |
connectorProvider(ConnectorProvider connectorProvider)
Register a custom Jersey client connector provider.
|
boolean |
equals(Object obj) |
ClientConfig |
executorService(ExecutorService executorService)
Register custom Jersey client async executor.
|
Set<Class<?>> |
getClasses() |
JerseyClient |
getClient()
Get the parent Jersey client this configuration is bound to.
|
ClientExecutor |
getClientExecutor() |
ClientConfig |
getConfiguration() |
Connector |
getConnector()
Get the client transport connector.
|
ConnectorProvider |
getConnectorProvider()
Get the client transport connector provider.
|
Map<Class<?>,Integer> |
getContracts(Class<?> componentClass) |
ExecutorService |
getExecutorService()
Get custom client executor service.
|
Set<Object> |
getInstances() |
Map<String,Object> |
getProperties() |
Object |
getProperty(String name) |
Collection<String> |
getPropertyNames() |
RuntimeType |
getRuntimeType() |
ScheduledExecutorService |
getScheduledExecutorService()
Get custom client scheduled executor service.
|
int |
hashCode() |
boolean |
isEnabled(Class<? extends Feature> featureClass) |
boolean |
isEnabled(Feature feature) |
boolean |
isProperty(String name)
Get the value of the property with a given name converted to
boolean . |
boolean |
isRegistered(Class<?> componentClass) |
boolean |
isRegistered(Object component) |
ClientConfig |
loadFrom(Configuration config)
Load the internal configuration state from an externally provided configuration state.
|
ClientConfig |
property(String name,
Object value) |
ClientConfig |
register(Class<?> providerClass) |
ClientConfig |
register(Class<?> providerClass,
Class<?>... contracts) |
ClientConfig |
register(Class<?> providerClass,
int bindingPriority) |
ClientConfig |
register(Class<?> providerClass,
Map<Class<?>,Integer> contracts) |
ClientConfig |
register(Object provider) |
ClientConfig |
register(Object provider,
Class<?>... contracts) |
ClientConfig |
register(Object provider,
int bindingPriority) |
ClientConfig |
register(Object provider,
Map<Class<?>,Integer> contracts) |
ClientConfig |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Register custom Jersey client scheduler.
|
public ClientConfig()
public ClientConfig(Class<?>... providerClasses)
providerClasses
- provider classes to be registered with this client configuration.public ClientConfig(Object... providers)
providers
- provider instances to be registered with this client configuration.public ClientConfig loadFrom(Configuration config)
Calling this method effectively replaces existing configuration state of the instance with the state represented by the externally provided configuration.
config
- external configuration state to replace the configuration of this configurable
instance.public ClientConfig register(Class<?> providerClass)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Object provider)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Class<?> providerClass, int bindingPriority)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Class<?> providerClass, Class<?>... contracts)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Class<?> providerClass, Map<Class<?>,Integer> contracts)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Object provider, int bindingPriority)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Object provider, Class<?>... contracts)
register
in interface Configurable<ClientConfig>
public ClientConfig register(Object provider, Map<Class<?>,Integer> contracts)
register
in interface Configurable<ClientConfig>
public ClientConfig property(String name, Object value)
property
in interface Configurable<ClientConfig>
public ClientConfig getConfiguration()
getConfiguration
in interface Configurable<ClientConfig>
public RuntimeType getRuntimeType()
getRuntimeType
in interface Configuration
public Map<String,Object> getProperties()
getProperties
in interface Configuration
public Object getProperty(String name)
getProperty
in interface Configuration
public Collection<String> getPropertyNames()
getPropertyNames
in interface Configuration
public boolean isProperty(String name)
ExtendedConfig
boolean
.
Returns false
if the value is not convertible.isProperty
in interface ExtendedConfig
name
- property name.boolean
property value or false
if the property is not
convertible.public boolean isEnabled(Feature feature)
isEnabled
in interface Configuration
public boolean isEnabled(Class<? extends Feature> featureClass)
isEnabled
in interface Configuration
public boolean isRegistered(Object component)
isRegistered
in interface Configuration
public Map<Class<?>,Integer> getContracts(Class<?> componentClass)
getContracts
in interface Configuration
public boolean isRegistered(Class<?> componentClass)
isRegistered
in interface Configuration
public Set<Class<?>> getClasses()
getClasses
in interface Configuration
public Set<Object> getInstances()
getInstances
in interface Configuration
public ClientConfig connectorProvider(ConnectorProvider connectorProvider)
The registered ConnectorProvider
instance will provide a
Jersey client Connector
for the JerseyClient
instance
created with this client configuration.
connectorProvider
- custom connector provider. Must not be null
.NullPointerException
- in case the connectorProvider
is null
.public ClientConfig executorService(ExecutorService executorService)
executorService
- custom executor service instancepublic ClientConfig scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
scheduledExecutorService
- custom scheduled executor service instancepublic Connector getConnector()
May return null
if no connector has been set.
public ConnectorProvider getConnectorProvider()
If no custom connector provider has been set,
default connector provider
instance is returned.
public ExecutorService getExecutorService()
May return null if no custom executor service has been set.
null
if not set.public ScheduledExecutorService getScheduledExecutorService()
May return null if no custom scheduled executor service has been set.
null
if not set.public ClientExecutor getClientExecutor()
public JerseyClient getClient()
May return null
if no parent client has been bound.
null
if not bound.Copyright © 2007-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.