|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.model.internal.DefaultConfig
public class DefaultConfig
Common Configurable implementation for server and client.
| Constructor Summary | |
|---|---|
DefaultConfig()
Creates a DefaultConfig instance; |
|
DefaultConfig(DefaultConfig configurable)
Copy constructor. |
|
DefaultConfig(java.util.Map<java.lang.String,java.lang.Object> properties)
|
|
DefaultConfig(java.util.Map<java.lang.String,java.lang.Object> properties,
ProviderBag providerBag,
FeatureBag featureBag)
|
|
| Method Summary | ||
|---|---|---|
protected java.util.Set<java.lang.Class<?>> |
checkContracts(java.lang.Class<?> providerClass,
java.util.Set<java.lang.Class<?>> allProviderContracts,
java.util.Set<java.lang.Class<?>> bindingContracts)
Checks whether a set of contracts is supported by this configuration. |
|
boolean |
equals(java.lang.Object obj)
|
|
FeatureBag |
getFeatureBag()
Returns a FeatureBag instance. |
|
java.util.Collection<Feature> |
getFeatures()
Get the immutable set of configured features. |
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Get the immutable bag of configuration properties. |
|
java.lang.Object |
getProperty(java.lang.String name)
Get the value for the property with a given name. |
|
ProviderBag |
getProviderBag()
Returns a ProviderBag instance. |
|
java.util.Set<java.lang.Class<?>> |
getProviderClasses()
Get the immutable set of registered provider classes to be instantiated, injected and utilized in the scope of the configured instance (excluding features). |
|
java.util.Set<java.lang.Object> |
getProviderInstances()
Get the immutable set of registered provider instances to be utilized by the configured instance (excluding features). |
|
int |
hashCode()
|
|
boolean |
isEnabled(java.lang.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(java.lang.Class<?> providerClass)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
Configurable |
register(java.lang.Class<?> providerClass,
int bindingPriority)
Register a provider or a feature class to be instantiated and used
in the scope of the configured instance. |
|
|
register(java.lang.Class<P> providerClass,
java.lang.Class<? super P>... contracts)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
|
register(java.lang.Class<P> providerClass,
int bindingPriority,
java.lang.Class<? super P>... contracts)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
Configurable |
register(java.lang.Object provider)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
|
register(java.lang.Object provider,
java.lang.Class<? super P>... contracts)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
Configurable |
register(java.lang.Object provider,
int bindingPriority)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
|
register(java.lang.Object provider,
int bindingPriority,
java.lang.Class<? super P>... contracts)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
Configurable |
setProperties(java.util.Map<java.lang.String,?> properties)
Set new configuration properties replacing all previously set properties. |
|
Configurable |
setProperty(java.lang.String name,
java.lang.Object value)
Set the new configuration property, if already set, the existing value of the property will be updated. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultConfig()
DefaultConfig instance;
public DefaultConfig(DefaultConfig configurable)
configurable - configurable to copy class properties from.public DefaultConfig(java.util.Map<java.lang.String,java.lang.Object> properties)
public DefaultConfig(java.util.Map<java.lang.String,java.lang.Object> properties,
ProviderBag providerBag,
FeatureBag featureBag)
| Method Detail |
|---|
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Configurable
getProperties in interface Configurablepublic java.lang.Object getProperty(java.lang.String name)
Configurable
getProperty in interface Configurablename - property name.
null
if the property with such name is not configured.public Configurable setProperties(java.util.Map<java.lang.String,?> properties)
Configurable
setProperties in interface Configurableproperties - new set of configuration properties. The content of
the map will replace any existing properties set on the configurable
instance.
public Configurable setProperty(java.lang.String name,
java.lang.Object value)
Configurablenull value into a property
effectively removes the property from the property bag.
setProperty in interface Configurablename - property name.value - (new) property value. null value removes the property
with the given name.
public java.util.Collection<Feature> getFeatures()
Configurable
The returned set contains the features that have already been successfully
configured in this configuration context.
getFeatures in interface Configurablenull.Feature.configure(Configurable)public java.util.Set<java.lang.Class<?>> getProviderClasses()
Configurablefeatures).
getProviderClasses in interface Configurablenull.Configurable.getProviderInstances()public java.util.Set<java.lang.Object> getProviderInstances()
Configurablefeatures).
When the configured instance is initialized the set of provider instances will be combined and take precedence over the instantiated registered provider classes.
getProviderInstances in interface Configurablenull.Configurable.getProviderClasses()public Configurable register(java.lang.Class<?> providerClass)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
The registered provider class is registered as a provider of all the recognized
JAX-RS or implementation-specific extension contracts.
As opposed to the providers registered by the
provider instances, providers
registered using this method are instantiated and properly injected
by the JAX-RS implementation provider. In case of a conflict between
a registered provider instance and instantiated registered provider class,
the registered provider instance takes precedence and the registered provider
class will not be instantiated in such case.
In case the registered class represents a feature,
this Configurable context instantiates the feature and invokes the
Feature.configure(javax.ws.rs.core.Configurable) method and
lets the feature update the configurable context. If the invocation
of Feature.configure(javax.ws.rs.core.Configurable) returns true
the feature is added to the collection of enabled features,
otherwise the feature instance is discarded.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.
public Configurable register(java.lang.Object provider)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
The registered provider is registered as a provider of all the recognized JAX-RS
or implementation-specific extension contracts.
As opposed to the providers registered by the
provider classes, provider instances
registered using this method are used "as is, i.e. are not managed or
injected by the JAX-RS implementation provider. In case of a conflict
between a registered provider instance and instantiated registered provider
class, the registered provider instance takes precedence and the registered
provider class will not be instantiated in such case.
In case the registered class represents a feature,
this Configurable context instantiates the feature and invokes the
Feature.configure(javax.ws.rs.core.Configurable) method and
lets the feature update the configurable context. If the invocation
of Feature.configure(javax.ws.rs.core.Configurable) returns true
the feature is added to the collection of enabled features,
otherwise the feature instance is discarded.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.
public Configurable register(java.lang.Class<?> providerClass,
int bindingPriority)
Configurablefeature class to be instantiated and used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class)
except that any provider binding priority specified on the provider class using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority cannot be applied to a particular provider
contract registered for the provider class, the supplied bindingPriority value
is ignored.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).
public <P> Configurable register(java.lang.Class<P> providerClass,
java.lang.Class<? super P>... contracts)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class)
except the provider class is only registered as a provider of the listed
contracts. Note that in case the Feature interface is not listed
explicitly, the provider class is not recognized as a JAX-RS feature.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public <P> Configurable register(java.lang.Class<P> providerClass,
int bindingPriority,
java.lang.Class<? super P>... contracts)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class, Class[])
except that any provider binding priority specified on the provider class using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority cannot be applied to a particular provider
contract registered for the provider class, the supplied bindingPriority value
is ignored.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public Configurable register(java.lang.Object provider,
int bindingPriority)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object)
except that any provider binding priority specified on the provider using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority cannot be applied to a particular provider
contract registered for the provider, the supplied bindingPriority value
is ignored.
register in interface Configurableprovider - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).
public <P> Configurable register(java.lang.Object provider,
java.lang.Class<? super P>... contracts)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object)
except the provider is only registered as a provider of the listed
contracts. Note that in case the Feature interface is not listed
explicitly, the provider is not recognized as a JAX-RS feature.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public <P> Configurable register(java.lang.Object provider,
int bindingPriority,
java.lang.Class<? super P>... contracts)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object, Class[])
except that any provider binding priority specified on the provider using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority cannot be applied to a particular provider
contract registered for the provider, the supplied bindingPriority value
is ignored.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.bindingPriority - the overriding binding priority for the registered contract(s).contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
protected java.util.Set<java.lang.Class<?>> checkContracts(java.lang.Class<?> providerClass,
java.util.Set<java.lang.Class<?>> allProviderContracts,
java.util.Set<java.lang.Class<?>> bindingContracts)
bindingContracts - set of contracts to perform check on.
public ProviderBag getProviderBag()
ProviderBag instance.
public FeatureBag getFeatureBag()
FeatureBag instance.
public boolean isEnabled(java.lang.Class<? extends Feature> featureClass)
Configurable or not.
featureClass - feature class to check.
true if the feature is enabled in this Configurable, false otherwise.public void lock()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||