org.glassfish.jersey.model.internal
Class DefaultConfig

java.lang.Object
  extended by org.glassfish.jersey.model.internal.DefaultConfig
All Implemented Interfaces:
Configurable

public class DefaultConfig
extends Object
implements Configurable

Common Configurable implementation for server and client.

Author:
Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
DefaultConfig()
          Creates a DefaultConfig instance;
DefaultConfig(DefaultConfig configurable)
          Copy constructor.
DefaultConfig(Map<String,Object> properties)
           
DefaultConfig(Map<String,Object> properties, ProviderBag providerBag, FeatureBag featureBag)
           
 
Method Summary
protected  Set<Class<?>> checkContracts(Class<?> providerClass, Set<Class<?>> allProviderContracts, Set<Class<?>> bindingContracts)
          Checks whether a set of contracts is supported by this configuration.
 boolean equals(Object obj)
           
 FeatureBag getFeatureBag()
          Returns a FeatureBag instance.
 Collection<Feature> getFeatures()
           
 Map<String,Object> getProperties()
           
 Object getProperty(String name)
           
 ProviderBag getProviderBag()
          Returns a ProviderBag instance.
 Set<Class<?>> getProviderClasses()
           
 Set<Object> getProviderInstances()
           
 int hashCode()
           
 boolean isEnabled(Class<? extends Feature> featureClass)
          Indicates whether is the given feature enabled in this Configurable or not.
 void lock()
          Locks this configuration so it cannot be modified.
 Configurable register(Class<?> providerClass)
           
 Configurable register(Class<?> providerClass, int bindingPriority)
           
<P> Configurable
register(Class<P> providerClass, Class<? super P>... contracts)
           
<P> Configurable
register(Class<P> providerClass, int bindingPriority, Class<? super P>... contracts)
           
 Configurable register(Object provider)
           
<P> Configurable
register(Object provider, Class<? super P>... contracts)
           
 Configurable register(Object provider, int bindingPriority)
           
<P> Configurable
register(Object provider, int bindingPriority, Class<? super P>... contracts)
           
 Configurable setProperties(Map<String,?> properties)
           
 Configurable setProperty(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConfig

public DefaultConfig()
Creates a DefaultConfig instance;


DefaultConfig

public DefaultConfig(DefaultConfig configurable)
Copy constructor.

Parameters:
configurable - configurable to copy class properties from.

DefaultConfig

public DefaultConfig(Map<String,Object> properties)

DefaultConfig

public DefaultConfig(Map<String,Object> properties,
                     ProviderBag providerBag,
                     FeatureBag featureBag)
Method Detail

getProperties

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

getProperty

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

setProperties

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

setProperty

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

getFeatures

public Collection<Feature> getFeatures()
Specified by:
getFeatures in interface Configurable

getProviderClasses

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

getProviderInstances

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

register

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

register

public Configurable register(Object provider)
Specified by:
register in interface Configurable

register

public Configurable register(Class<?> providerClass,
                             int bindingPriority)
Specified by:
register in interface Configurable

register

public <P> Configurable register(Class<P> providerClass,
                                 Class<? super P>... contracts)
Specified by:
register in interface Configurable

register

public <P> Configurable register(Class<P> providerClass,
                                 int bindingPriority,
                                 Class<? super P>... contracts)
Specified by:
register in interface Configurable

register

public Configurable register(Object provider,
                             int bindingPriority)
Specified by:
register in interface Configurable

register

public <P> Configurable register(Object provider,
                                 Class<? super P>... contracts)
Specified by:
register in interface Configurable

register

public <P> Configurable register(Object provider,
                                 int bindingPriority,
                                 Class<? super P>... contracts)
Specified by:
register in interface Configurable

checkContracts

protected Set<Class<?>> checkContracts(Class<?> providerClass,
                                       Set<Class<?>> allProviderContracts,
                                       Set<Class<?>> bindingContracts)
Checks whether a set of contracts is supported by this configuration. Method should log a warning message if a certain contract is not allowed by this configuration and it returns (modified) set of allowed contracts.

Parameters:
bindingContracts - set of contracts to perform check on.
Returns:
set of contracts allowed by this configuration.

getProviderBag

public ProviderBag getProviderBag()
Returns a ProviderBag instance.

Returns:
a non-null provider bag instance.

getFeatureBag

public FeatureBag getFeatureBag()
Returns a FeatureBag instance.

Returns:
a non-null feature bag instance.

isEnabled

public boolean isEnabled(Class<? extends Feature> featureClass)
Indicates whether is the given feature enabled in this Configurable or not.

Parameters:
featureClass - feature class to check.
Returns:
true if the feature is enabled in this Configurable, false otherwise.

lock

public void lock()
Locks this configuration so it cannot be modified.


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.