public interface ClientConfig extends FeaturesAndProperties
Client
instance.
An instance of this interface may be passed to the Client
when
the client is created as follows:
The client configuration may be used to register provider classes such as those, for example, that support JAXB with JSON as follows:ClientConfig cc = ... Client c = Client.create(cc);
Alternatively an implementation of ClientConfig could perform such registration.ClientConfig cc = new DefaultClientConfig(); cc.getClasses().add(com.sun.jersey.impl.provider.entity.JSONRootElementProvider.class); Client c = Client.create(cc);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION
A value of "true" declares that the client will
automatically buffer the response entity (if any) and close resources
when a UniformInterfaceException is thrown.
|
static java.lang.String |
PROPERTY_CHUNKED_ENCODING_SIZE
Chunked encoding property.
|
static java.lang.String |
PROPERTY_CONNECT_TIMEOUT
Connect timeout interval property, in milliseconds.
|
static java.lang.String |
PROPERTY_FOLLOW_REDIRECTS
Redirection property.
|
static java.lang.String |
PROPERTY_READ_TIMEOUT
Read timeout interval property, in milliseconds.
|
static java.lang.String |
PROPERTY_THREADPOOL_SIZE
Threadpool size property.
|
FEATURE_DISABLE_XML_SECURITY, FEATURE_FORMATTED, FEATURE_PRE_1_4_PROVIDER_PRECEDENCE, FEATURE_XMLROOTELEMENT_PROCESSING
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Class<?>> |
getClasses()
Get the set of provider classes to be instantiated in the scope
of the Client
|
boolean |
getPropertyAsFeature(java.lang.String featureName)
Get a feature that is boolean property of the property bag.
|
java.util.Set<java.lang.Object> |
getSingletons()
Get the singleton provider instances to be utilized by the client.
|
getFeature, getFeatures, getProperties, getProperty
static final java.lang.String PROPERTY_FOLLOW_REDIRECTS
Boolean
.
If the property is absent then the default value is "true".static final java.lang.String PROPERTY_READ_TIMEOUT
Integer
.
If the property is absent then the default value is an interval of
infinity. A value of zero 0 is equivalent to an interval of
infinitystatic final java.lang.String PROPERTY_CONNECT_TIMEOUT
Integer
.
If the property is absent then the default value is an interval of
infinity. A value of 0 is equivalent to an interval of
infinitystatic final java.lang.String PROPERTY_CHUNKED_ENCODING_SIZE
The value MUST be an instance of Integer
.
If the property is absent then chunked encoding will not be used. A value < = 0 declares that chunked encoding will be used with the default chunk size. A value > 0 declares that chunked encoding will be used with the value as the declared chunk size.
Note, that this is the default behaviour for the client which does not have to be implemented by allclient
implementations. A client can define
different default behaviour if it is not capable of supporting buffering
for example.static final java.lang.String PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION
Boolean
.
If the property is absent then the default value is "true".static final java.lang.String PROPERTY_THREADPOOL_SIZE
Integer
.
If the property is absent then threadpool used for async requests will
be initialized as default cached threadpool, which creates new thread
for every new request, see Executors
. When
value bigger than zero is provided, cached threadpool limited to that
number of threads will be utilized.java.util.Set<java.lang.Class<?>> getClasses()
A provider class is a Java class with a Provider
annotation declared on the class that implements a specific service
interface.
java.util.Set<java.lang.Object> getSingletons()
When the client is initialized the set of provider instances will be combined and take precedence over the instances of provider classes.
boolean getPropertyAsFeature(java.lang.String featureName)
featureName
- the name of the feature;Boolean
and that value is true, otherwise false.Copyright © 2016 Oracle Corporation. All Rights Reserved.