|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl
public class ComponentDefinitionRegistryImpl
ComponentDefinitionRegistry implementation. This implementation uses concurrent lists and maps to store components and converters metadata to allow its use by concurrent threads.
| Constructor Summary | |
|---|---|
ComponentDefinitionRegistryImpl()
|
|
| Method Summary | |
|---|---|
boolean |
containsComponentDefinition(String name)
Determine if the component registry contains a component definition for the given id |
ComponentMetadata |
getComponentDefinition(String name)
Retrieve a component's metadata by id |
Set<String> |
getComponentDefinitionNames()
Returns a set of the id of top-level blueprint components (both named and unnamed). |
List<Interceptor> |
getInterceptors(ComponentMetadata component)
Retrieve all interceptors registered against a ComponentMetadata instance |
List<Target> |
getTypeConverters()
|
void |
registerComponentDefinition(ComponentMetadata component)
Register a new component The ComponentMetadata argument must have an id. |
void |
registerInterceptorWithComponent(ComponentMetadata component,
Interceptor interceptor)
Register an interceptor for a given component Since the interceptor is registered against a ComponentMetadata instance and not an id,
interceptors can be registered for anonymous components as well as named and unnamed components. |
void |
registerTypeConverter(Target component)
|
void |
removeComponentDefinition(String name)
Remove the component definition with a given id If no component is registered under the id, this method is a no-op. |
void |
reset()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComponentDefinitionRegistryImpl()
| Method Detail |
|---|
public void reset()
public boolean containsComponentDefinition(String name)
ComponentDefinitionRegistry
containsComponentDefinition in interface ComponentDefinitionRegistrypublic ComponentMetadata getComponentDefinition(String name)
ComponentDefinitionRegistry
getComponentDefinition in interface ComponentDefinitionRegistryname - The id of the component. This is either the id specified in the Blueprint xml or the
generated id of an unnamed component
ComponentMetadata or null if the id does not match
any registered componentpublic Set<String> getComponentDefinitionNames()
ComponentDefinitionRegistry
getComponentDefinitionNames in interface ComponentDefinitionRegistrypublic void registerComponentDefinition(ComponentMetadata component)
ComponentDefinitionRegistryComponentMetadata argument must have an id. So unnamed components should have an id
generated prior to invoking this method. Also, no component definition may already be registered
under the same id.
registerComponentDefinition in interface ComponentDefinitionRegistrycomponent - the component to be registeredpublic void removeComponentDefinition(String name)
ComponentDefinitionRegistry
removeComponentDefinition in interface ComponentDefinitionRegistryname - the id of the component definition to be removedpublic void registerTypeConverter(Target component)
registerTypeConverter in interface ComponentDefinitionRegistrypublic List<Target> getTypeConverters()
getTypeConverters in interface ComponentDefinitionRegistry
public void registerInterceptorWithComponent(ComponentMetadata component,
Interceptor interceptor)
ComponentDefinitionRegistryComponentMetadata instance and not an id,
interceptors can be registered for anonymous components as well as named and unnamed components.
Note: Although an interceptor is registered against a specific ComponentMetadata instance,
an interceptor should not rely on this fact. This will allow NamespaceHandlers and
ComponentDefinitionRegistryProcessors to respect registered interceptors even when
the actual ComponentMetadata instance is changed or augmented. If an interceptor does
not support such a scenario it should nevertheless fail gracefully in the case of modified
ComponentMetadata instances.
Note: at the time of this writing (version 0.1) interceptors are only supported for BeanMetadata.
Interceptors registered against other component types will be ignored.
registerInterceptorWithComponent in interface ComponentDefinitionRegistrycomponent - the component the interceptor is to be registered againstinterceptor - the interceptor to be usedpublic List<Interceptor> getInterceptors(ComponentMetadata component)
ComponentDefinitionRegistryComponentMetadata instance
getInterceptors in interface ComponentDefinitionRegistry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||