org.glassfish.jersey.client
Class ClientConfig

java.lang.Object
  extended by org.glassfish.jersey.client.ClientConfig
All Implemented Interfaces:
Configuration, Config

public class ClientConfig
extends Object
implements Configuration, Config

Jersey implementation of JAX-RS client configuration contract.

Author:
Marek Potociar (marek.potociar at oracle.com), Martin Matula (martin.matula at oracle.com)

Constructor Summary
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.
 
Method Summary
 ClientConfig binders(Binder... binders)
          Register custom HK2 binders.
 ClientConfig connector(Inflector<ClientRequest,ClientResponse> connector)
          Set Jersey client transport connector.
 boolean equals(Object obj)
           
 JerseyClient getClient()
          Get the parent Jersey client this configuration is bound to.
 Inflector<ClientRequest,ClientResponse> getConnector()
          Get the client transport connector.
 Set<Feature> getFeatures()
           
 Map<String,Object> getProperties()
           
 Object getProperty(String name)
           
 Set<Class<?>> getProviderClasses()
           
 Set<Object> getProviderInstances()
           
 int hashCode()
           
 boolean isEnabled(Class<? extends Feature> feature)
          Check if the given feature is enabled or not.
 boolean isProperty(String name)
           
 ClientConfig register(Class<?> providerClass)
           
 ClientConfig register(Object provider)
           
 ClientConfig setProperties(Map<String,?> properties)
           
 ClientConfig setProperty(String name, Object value)
           
 ClientConfig update(Configuration configuration)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientConfig

public ClientConfig()
Construct a new Jersey configuration instance with the default features and property values.


ClientConfig

public ClientConfig(Class<?>... providerClasses)
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

public ClientConfig(Object... providers)
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 Detail

getProperties

public Map<String,Object> getProperties()
Specified by:
getProperties in interface Configuration
Specified by:
getProperties in interface Config

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface Configuration
Specified by:
getProperty in interface Config

isProperty

public boolean isProperty(String name)
Specified by:
isProperty in interface Config

getFeatures

public Set<Feature> getFeatures()
Specified by:
getFeatures in interface Configuration

isEnabled

public boolean isEnabled(Class<? extends Feature> feature)
Check if the given feature is enabled or not.

Parameters:
feature - tested feature.
Returns:
true in case

getProviderClasses

public Set<Class<?>> getProviderClasses()
Specified by:
getProviderClasses in interface Configuration

getProviderInstances

public Set<Object> getProviderInstances()
Specified by:
getProviderInstances in interface Configuration

update

public ClientConfig update(Configuration configuration)
Specified by:
update in interface Configuration

register

public ClientConfig register(Class<?> providerClass)
Specified by:
register in interface Configuration

register

public ClientConfig register(Object provider)
Specified by:
register in interface Configuration

setProperties

public ClientConfig setProperties(Map<String,?> properties)
Specified by:
setProperties in interface Configuration

setProperty

public ClientConfig setProperty(String name,
                                Object value)
Specified by:
setProperty in interface Configuration

connector

public ClientConfig connector(Inflector<ClientRequest,ClientResponse> connector)
Set Jersey client transport connector.

Parameters:
connector - client transport connector.
Returns:
this client config instance.

binders

public ClientConfig binders(Binder... binders)
Register custom HK2 binders.

Parameters:
binders - custom HK2 binders to be registered with the Jersey client.
Returns:
this client config instance.

getConnector

public Inflector<ClientRequest,ClientResponse> 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.

getClient

public JerseyClient 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

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.