Class ComponentBag.ImmutableComponentBag
- java.lang.Object
-
- org.glassfish.jersey.model.internal.ComponentBag
-
- org.glassfish.jersey.model.internal.ComponentBag.ImmutableComponentBag
-
- Enclosing class:
- ComponentBag
private static class ComponentBag.ImmutableComponentBag extends ComponentBag
Immutable version ofComponentBag
.
-
-
Field Summary
-
Fields inherited from class org.glassfish.jersey.model.internal.ComponentBag
AS_IS, BINDERS_ONLY, EXCLUDE_EMPTY, EXECUTOR_SERVICE_PROVIDER_ONLY, EXTERNAL_ONLY, INCLUDE_ALL, SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY
-
-
Constructor Summary
Constructors Constructor Description ImmutableComponentBag(ComponentBag original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all the component registrations and resets the component bag instance to a state as if it was create anew.ComponentBag
copy()
Get a copy of this component bag.ComponentBag
immutableCopy()
Get immutable copy of a component bag.boolean
register(java.lang.Class<?> componentClass, int priority, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component class as a contract provider with an explicitly specified binding priority.boolean
register(java.lang.Class<?> componentClass, java.util.Map<java.lang.Class<?>,java.lang.Integer> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component class as a contract provider for the specified contracts.boolean
register(java.lang.Class<?> componentClass, java.util.Set<java.lang.Class<?>> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component class as a contract provider for the specified contracts.boolean
register(java.lang.Class<?> componentClass, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component class using a given registration strategy.boolean
register(java.lang.Object component, int priority, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component as a contract provider with an explicitly specified binding priority.boolean
register(java.lang.Object component, java.util.Map<java.lang.Class<?>,java.lang.Integer> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component as a contract provider for the specified contracts.boolean
register(java.lang.Object component, java.util.Set<java.lang.Class<?>> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component as a contract provider for the specified contracts.boolean
register(java.lang.Object component, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Register a component using a given registration strategy.-
Methods inherited from class org.glassfish.jersey.model.internal.ComponentBag
excludeMetaProviders, getClasses, getClasses, getFromBinders, getInstances, getInstances, getModel, getRegistrations, loadFrom, modelFor, newInstance
-
-
-
-
Constructor Detail
-
ImmutableComponentBag
ImmutableComponentBag(ComponentBag original)
-
-
Method Detail
-
register
public boolean register(java.lang.Class<?> componentClass, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component class using a given registration strategy.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered, based on the registration strategy decision.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Class<?> componentClass, int priority, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component class as a contract provider with an explicitly specified binding priority.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.priority
- explicitly specified binding priority for the provider contracts implemented by the component.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Class<?> componentClass, java.util.Set<java.lang.Class<?>> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component class as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.contracts
- contracts to bind the component class to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Class<?> componentClass, java.util.Map<java.lang.Class<?>,java.lang.Integer> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component class as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.contracts
- contracts with their priorities to bind the component class to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Object component, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component using a given registration strategy.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Object component, int priority, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component as a contract provider with an explicitly specified binding priority.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.priority
- explicitly specified binding priority for the provider contracts implemented by the component.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Object component, java.util.Set<java.lang.Class<?>> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.contracts
- contracts to bind the component to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(java.lang.Object component, java.util.Map<java.lang.Class<?>,java.lang.Integer> contracts, Inflector<ContractProvider.Builder,ContractProvider> modelEnhancer)
Description copied from class:ComponentBag
Register a component as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.contracts
- contracts with their priorities to bind the component to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
copy
public ComponentBag copy()
Description copied from class:ComponentBag
Get a copy of this component bag.- Overrides:
copy
in classComponentBag
- Returns:
- component bag copy.
-
immutableCopy
public ComponentBag immutableCopy()
Description copied from class:ComponentBag
Get immutable copy of a component bag.- Overrides:
immutableCopy
in classComponentBag
- Returns:
- immutable view of a component bag.
-
clear
public void clear()
Description copied from class:ComponentBag
Removes all the component registrations and resets the component bag instance to a state as if it was create anew.- Overrides:
clear
in classComponentBag
-
-