public interface Configuration
configurable
context.
Defines the components as well as additional meta-data for the configured context.
A configuration state may be used to retrieve configuration information about
of the associated context (e.g. application, resource method, etc.) or component
(e.g. Client
, WebTarget
, etc.).
Configuration information consists of properties, registered component classes
and/or instances.
This interface can be injected using the Context
annotation.
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Class<?>> |
getClasses()
Get the immutable set of registered component (such as provider or
feature ) classes to be instantiated, injected and utilized in the scope
of the configurable instance. |
java.util.Map<java.lang.Class<?>,java.lang.Integer> |
getContracts(java.lang.Class<?> componentClass)
Get the extension contract registration information for a component of a given class.
|
java.util.Set<java.lang.Object> |
getInstances()
Get the immutable set of registered component (such as provider or
feature ) instances to be utilized by the configurable instance. |
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.Collection<java.lang.String> |
getPropertyNames()
Returns an immutable
collection containing the
property names available within the context of the current configuration instance. |
RuntimeType |
getRuntimeType()
Get the runtime type of this configuration context.
|
boolean |
isEnabled(java.lang.Class<? extends Feature> featureClass)
Check if a
feature instance of featureClass class has been
previously enabled in the runtime configuration context. |
boolean |
isEnabled(Feature feature)
Check if a particular
feature instance has been previously
enabled in the runtime configuration context. |
boolean |
isRegistered(java.lang.Class<?> componentClass)
Check if a component of the supplied
componentClass class has been previously
registered in the runtime configuration context. |
boolean |
isRegistered(java.lang.Object component)
Check if a particular API
component instance (such as providers or
features ) has been previously registered in the runtime configuration context. |
RuntimeType getRuntimeType()
java.util.Map<java.lang.String,java.lang.Object> getProperties()
java.lang.Object getProperty(java.lang.String name)
name
- property name.null
if the property with such name is not configured.java.util.Collection<java.lang.String> getPropertyNames()
collection
containing the
property names available within the context of the current configuration instance.
Use the getProperty(java.lang.String)
method with a property name to get the value of
a property.
collection
of property names.getProperty(java.lang.String)
boolean isEnabled(Feature feature)
feature
instance has been previously
enabled in the runtime configuration context.
Method returns true
only in case an instance equal to the feature
instance is already present among the features previously successfully enabled in
the configuration context.
feature
- a feature instance to test for.true
if the feature instance has been previously enabled in this
configuration context, false
otherwise.boolean isEnabled(java.lang.Class<? extends Feature> featureClass)
feature
instance of featureClass
class has been
previously enabled in the runtime configuration context.
Method returns true
in case any instance of the featureClass
class is
already present among the features previously successfully enabled in the configuration
context.
featureClass
- a feature class to test for.true
if a feature of a given class has been previously enabled in this
configuration context, false
otherwise.boolean isRegistered(java.lang.Object component)
component
instance (such as providers or
features
) has been previously registered in the runtime configuration context.
Method returns true
only in case an instance equal to the component
instance is already present among the components previously registered in the configuration
context.
component
- a component instance to test for.true
if the component instance has been previously registered in this
configuration context, false
otherwise.isEnabled(Feature)
boolean isRegistered(java.lang.Class<?> componentClass)
componentClass
class has been previously
registered in the runtime configuration context.
Method returns true
in case a component of the supplied componentClass
class
is already present among the previously registered component classes or instances
in the configuration context.
componentClass
- a component class to test for.true
if a component of a given class has been previously registered in this
configuration context, false
otherwise.isEnabled(Class)
java.util.Map<java.lang.Class<?>,java.lang.Integer> getContracts(java.lang.Class<?> componentClass)
Map
. Method does not return null
.java.util.Set<java.lang.Class<?>> getClasses()
feature
) classes to be instantiated, injected and utilized in the scope
of the configurable instance.
For each component type, there can be only a single class-based or instance-based registration present in the configuration context at any given time.
null
.getInstances()
java.util.Set<java.lang.Object> getInstances()
feature
) instances to be utilized by the configurable instance.
Fields and properties of returned instances are injected with their declared dependencies
(see Context
) by the runtime prior to use.
For each component type, there can be only a single class-based or instance-based registration present in the configuration context at any given time.
null
.getClasses()