|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Configuration
Represents inheritable configuration of the main client-side JAX-RS components,
such as Client, Target, Invocation Builder
or Invocation.
resource targets using a Client instance,
the configuration of the Client instance is inherited by the child target
instances being created. Similarly, when creating new
Invocation.Builder invocation builders or derived resource targets
using a parent target instance, the configuration of the parent target is
inherited by the child instances being created.
The inherited configuration on a child instance reflects the state of the parent
configuration at the time of the child instance creation. Once the child instance
is created its configuration is detached from the parent configuration. This means
that any subsequent changes in the parent configuration do not affect
the configuration of previously created child instances.
Once the child instance is created, it's configuration can be further customized
using the provided set of instance configuration mutator methods. A change
made in the configuration of a child instance does not affect the configuration
of its parent.
TODO example.
| Method Summary | |
|---|---|
Configuration |
disable(java.lang.Class<? extends Feature> feature)
Disable a feature for the configurable instance using a feature class. |
Configuration |
enable(java.lang.Class<? extends Feature> feature)
Enable a feature using the feature class. |
Configuration |
enable(Feature feature)
Enable a feature using a feature instance. |
java.util.Set<Feature> |
getFeatures()
Get the immutable set of enabled 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. |
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. |
java.util.Set<java.lang.Object> |
getProviderInstances()
Get the immutable set of registered provider instances to be utilized by the configured instance. |
boolean |
isEnabled(java.lang.Class<? extends Feature> feature)
Determine if a certain feature is enabled or not. |
Configuration |
register(java.lang.Class<?> providerClass)
Register a provider class to be instantiated and used in the scope of the configured instance. |
Configuration |
register(java.lang.Object provider)
Register a provider ("singleton") instance to be used in the scope of the configured instance. |
Configuration |
setProperties(java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set new configuration properties replacing all previously set properties. |
Configuration |
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. |
Configuration |
update(Configuration configuration)
Replace the existing configuration state with the configuration state of the externally provided configuration. |
| Method Detail |
|---|
java.util.Map<java.lang.String,java.lang.Object> getProperties()
Configurationjava.lang.Object getProperty(java.lang.String name)
name - property name.
null
if the property with such name is not configured.Configurationjava.util.Set<Feature> getFeatures()
null.boolean isEnabled(java.lang.Class<? extends Feature> feature)
feature - the feature class.
true if the feature is enabled, otherwise false.Configurationjava.util.Set<java.lang.Class<?>> getProviderClasses()
Provider
annotation declared on the class that implements a specific service
interface.
null.getProviderInstances()java.util.Set<java.lang.Object> getProviderInstances()
null.getProviderClasses()Configuration update(Configuration configuration)
configuration - configuration to be used to update the instance.
Configuration register(java.lang.Class<?> providerClass)
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.
providerClass - provider class to be instantiated and used in the scope
of the configured instance.
getProviderClasses()Configuration register(java.lang.Object provider)
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.
provider - a provider instance to be used in the scope of the configured
instance.
getProviderInstances()Configuration enable(java.lang.Class<? extends Feature> feature)
feature instances, features
enabled using this method are instantiated and properly injected
by the JAX-RS implementation provider before executing the
Feature.onEnable(javax.ws.rs.client.Configuration) method.
TODO specify repeated feature enabling behavior.
feature - class of the feature to be enabled.
ConfigurationConfiguration enable(Feature feature)
feature classes, features
enabled using this method are not managed or injected
by the JAX-RS implementation provider. The JAX-RS runtime merely invokes
the Feature.onEnable(javax.ws.rs.client.Configuration) method.
TODO specify repeated feature enabling behavior.
feature - instance of the feature to be enabled.
ConfigurationConfiguration disable(java.lang.Class<? extends Feature> feature)
feature - class of the feature to be disabled.
ConfigurationConfiguration setProperties(java.util.Map<java.lang.String,? extends java.lang.Object> properties)
properties - new set of configuration properties. The content of
the map will replace any existing properties set on the configurable
instance.
Configuration
Configuration setProperty(java.lang.String name,
java.lang.Object value)
null value into a property
effectively removes the property from the property bag.
name - property name.value - (new) property value. null value removes the property
with the given name.
Configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||