|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.model.internal.CommonConfig
public class CommonConfig
Common immutable Configuration implementation for
server and client.
| Constructor Summary | |
|---|---|
CommonConfig(CommonConfig config)
Copy constructor. |
|
CommonConfig(RuntimeType type,
com.google.common.base.Predicate<ContractProvider> registrationStrategy)
Create a new RuntimeConfig instance. |
|
| Method Summary | |
|---|---|
CommonConfig |
addProperties(Map<String,?> properties)
Add properties to ResourceConfig. |
void |
configureMetaProviders(ServiceLocator locator)
Configure HK2 binders in the HK2 service locator and enable JAX-RS features. |
boolean |
equals(Object o)
|
Set<Class<?>> |
getClasses()
|
ComponentBag |
getComponentBag()
Returns a ComponentBag instance associated with the configuration. |
ExtendedConfig |
getConfiguration()
|
Map<Class<?>,Integer> |
getContracts(Class<?> componentClass)
|
Set<Object> |
getInstances()
|
protected Inflector<ContractProvider.Builder,ContractProvider> |
getModelEnhancer(Class<?> componentClass)
An extension point that provides a way how to define a custom enhancement/update operation of a contract provider model registration being produced for a given component class. |
Map<String,Object> |
getProperties()
|
Object |
getProperty(String name)
|
Collection<String> |
getPropertyNames()
|
RuntimeType |
getRuntimeType()
|
int |
hashCode()
|
boolean |
isEnabled(Class<? extends Feature> featureClass)
|
boolean |
isEnabled(Feature feature)
|
boolean |
isProperty(String name)
Get the value of the property with a given name converted to boolean. |
boolean |
isRegistered(Class<?> componentClass)
|
boolean |
isRegistered(Object component)
|
CommonConfig |
property(String name,
Object value)
|
CommonConfig |
register(Class<?> componentClass)
|
CommonConfig |
register(Class<?> componentClass,
Class<?>... contracts)
|
CommonConfig |
register(Class<?> componentClass,
int bindingPriority)
|
CommonConfig |
register(Class<?> componentClass,
Map<Class<?>,Integer> contracts)
|
CommonConfig |
register(Object component)
|
CommonConfig |
register(Object component,
Class<?>... contracts)
|
CommonConfig |
register(Object component,
int bindingPriority)
|
CommonConfig |
register(Object component,
Map<Class<?>,Integer> contracts)
|
CommonConfig |
replaceWith(Configuration config)
|
CommonConfig |
setProperties(Map<String,?> properties)
Set the configured properties to the provided map of properties. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommonConfig(RuntimeType type,
com.google.common.base.Predicate<ContractProvider> registrationStrategy)
RuntimeConfig instance.
The constructor provides a way for defining a contract
provider model registration strategy. Once a registration model is built
for a newly registered contract, the provided registration strategy filter is
consulted whether the model should be registered or not.
Clients can use the method to cancel any contract provider model registration that does not meet the criteria of a given configuration context, such as a model that does not have any recognized contracts associated with it.
type - configuration runtime type.registrationStrategy - function driving the decision (based on the introspected
contract provider model) whether
or not should the component class registration continue
towards a successful completion.public CommonConfig(CommonConfig config)
config - configurable to copy class properties from.| Method Detail |
|---|
public ExtendedConfig getConfiguration()
getConfiguration in interface Configurable<FeatureContext>public RuntimeType getRuntimeType()
getRuntimeType in interface Configurationpublic Map<String,Object> getProperties()
getProperties in interface Configurationpublic Object getProperty(String name)
getProperty in interface Configurationpublic boolean isProperty(String name)
ExtendedConfigboolean.
Returns false if the value is not convertible.
isProperty in interface ExtendedConfigname - property name.
boolean property value or false if the property is not
convertible.public Collection<String> getPropertyNames()
getPropertyNames in interface Configurationpublic boolean isEnabled(Class<? extends Feature> featureClass)
isEnabled in interface Configurationpublic boolean isEnabled(Feature feature)
isEnabled in interface Configurationpublic boolean isRegistered(Object component)
isRegistered in interface Configurationpublic boolean isRegistered(Class<?> componentClass)
isRegistered in interface Configurationpublic Map<Class<?>,Integer> getContracts(Class<?> componentClass)
getContracts in interface Configurationpublic Set<Class<?>> getClasses()
getClasses in interface Configurationpublic Set<Object> getInstances()
getInstances in interface Configurationpublic final ComponentBag getComponentBag()
ComponentBag instance associated with the configuration.
protected Inflector<ContractProvider.Builder,ContractProvider> getModelEnhancer(Class<?> componentClass)
Derived implementations may use this method to e.g. filter out all contracts not applicable in the given configuration context or change the model scope. The returned set of filtered contracts is then used for the actual provider registration.
componentClass - class of the component being registered.
public CommonConfig setProperties(Map<String,?> properties)
properties - new map of properties to be set.
public CommonConfig addProperties(Map<String,?> properties)
ResourceConfig.
If any of the added properties exists already, he values of the existing
properties will be replaced with new values.
properties - properties to add.
public CommonConfig property(String name,
Object value)
property in interface Configurable<FeatureContext>public CommonConfig register(Class<?> componentClass)
register in interface Configurable<FeatureContext>
public CommonConfig register(Class<?> componentClass,
int bindingPriority)
register in interface Configurable<FeatureContext>
public CommonConfig register(Class<?> componentClass,
Class<?>... contracts)
register in interface Configurable<FeatureContext>
public CommonConfig register(Class<?> componentClass,
Map<Class<?>,Integer> contracts)
register in interface Configurable<FeatureContext>public CommonConfig register(Object component)
register in interface Configurable<FeatureContext>
public CommonConfig register(Object component,
int bindingPriority)
register in interface Configurable<FeatureContext>
public CommonConfig register(Object component,
Class<?>... contracts)
register in interface Configurable<FeatureContext>
public CommonConfig register(Object component,
Map<Class<?>,Integer> contracts)
register in interface Configurable<FeatureContext>public CommonConfig replaceWith(Configuration config)
replaceWith in interface Configurable<FeatureContext>public void configureMetaProviders(ServiceLocator locator)
locator - locator in which the binders and features should be configured.public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||