org.apache.aries.blueprint
Interface ComponentDefinitionRegistry

All Known Implementing Classes:
ComponentDefinitionRegistryImpl

public interface ComponentDefinitionRegistry


Method Summary
 boolean containsComponentDefinition(java.lang.String id)
          Determine if the component registry contains a component definition for the given id
 ComponentMetadata getComponentDefinition(java.lang.String id)
          Retrieve a component's metadata by id
 java.util.Set<java.lang.String> getComponentDefinitionNames()
          Returns a set of the id of top-level blueprint components (both named and unnamed).
 java.util.List<Interceptor> getInterceptors(ComponentMetadata component)
          Retrieve all interceptors registered against a ComponentMetadata instance
 java.util.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(java.lang.String id)
          Remove the component definition with a given id If no component is registered under the id, this method is a no-op.
 

Method Detail

containsComponentDefinition

boolean containsComponentDefinition(java.lang.String id)
Determine if the component registry contains a component definition for the given id

Parameters:
id -
Returns:

getComponentDefinition

ComponentMetadata getComponentDefinition(java.lang.String id)
Retrieve a component's metadata by id

Parameters:
id - The id of the component. This is either the id specified in the Blueprint xml or the generated id of an unnamed component
Returns:
the ComponentMetadata or null if the id does not match any registered component

getComponentDefinitionNames

java.util.Set<java.lang.String> getComponentDefinitionNames()
Returns a set of the id of top-level blueprint components (both named and unnamed). The ids of unnamed components are Blueprint generated. Anonymous components, which have no id, are not part of the set.

Returns:

registerComponentDefinition

void registerComponentDefinition(ComponentMetadata component)
Register a new component The ComponentMetadata 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.

Parameters:
component - the component to be registered
Throws:
java.lang.IllegalArgumentException - if the component has no id
ComponentNameAlreadyInUseException - if there already exists a component definition in the registry with the same id

removeComponentDefinition

void removeComponentDefinition(java.lang.String id)
Remove the component definition with a given id If no component is registered under the id, this method is a no-op.

Parameters:
id - the id of the component definition to be removed

registerTypeConverter

void registerTypeConverter(Target component)

getTypeConverters

java.util.List<Target> getTypeConverters()

registerInterceptorWithComponent

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. 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.

Parameters:
component - the component the interceptor is to be registered against
interceptor - the interceptor to be used

getInterceptors

java.util.List<Interceptor> getInterceptors(ComponentMetadata component)
Retrieve all interceptors registered against a ComponentMetadata instance

Parameters:
component -
Returns:
a list of interceptors sorted by decreasing rank. The list may be empty if no interceptors have been defined


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.