Interface ComponentDescriptorRegistry
-
- All Known Subinterfaces:
ComponentFactory
- All Known Implementing Classes:
ContextAwareComponentFactory
,DefaultComponentFactory
,DelegatingComponentFactory
public interface ComponentDescriptorRegistry
-
-
Method Summary
-
-
-
Method Detail
-
findAllDescriptorsByClass
<T> Collection<ComponentDescriptor<T>> findAllDescriptorsByClass(Class<T> type)
Finds allComponentDescriptor
registered for the specified type.- Type Parameters:
T
- the component type.- Parameters:
type
- the component class.- Returns:
- the collection of
ComponentDescriptor
.
-
findAllDescriptorsByClass
<T> Collection<ComponentDescriptor<T>> findAllDescriptorsByClass(Class<T> type, Qualifier<T> qualifier)
Finds allComponentDescriptor
registered for the specified type.- Type Parameters:
T
- the component type.- Parameters:
type
- the component class.- Returns:
- the collection of
ComponentDescriptor
.
-
findAllDescriptorsByAlias
<T> Collection<ComponentDescriptor<T>> findAllDescriptorsByAlias(String alias)
Finds allComponentDescriptor
registered for the specified alias.- Type Parameters:
T
- the component type.- Parameters:
alias
- the fully qualified class name or an alias of the component.- Returns:
- the collection of
ComponentDescriptor
.
-
findAllDescriptorsByAlias
<T> Collection<ComponentDescriptor<T>> findAllDescriptorsByAlias(String alias, Qualifier<T> qualifier)
Finds allComponentDescriptor
registered for the specified alias.- Type Parameters:
T
- the component type.- Parameters:
alias
- the fully qualified class name or an alias of the component.- Returns:
- the collection of
ComponentDescriptor
.
-
findDescriptorByAlias
<T> Optional<ComponentDescriptor<T>> findDescriptorByAlias(String alias)
Finds aComponentDescriptor
for the specified type.- Type Parameters:
T
- the component type.- Parameters:
alias
- the fully qualified class name or an alias of the component.- Returns:
- the optional
ComponentDescriptor
instance. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.
-
findDescriptorByAlias
<T> Optional<ComponentDescriptor<T>> findDescriptorByAlias(String alias, Qualifier<T> qualifier)
Finds aComponentDescriptor
for the specified type and options.- Type Parameters:
T
- the component type.- Parameters:
alias
- the fully qualified class name or an alias of the component.qualifier
- the options used to qualified the component.- Returns:
- the optional
ComponentDescriptor
instance. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.
-
findDescriptorByClass
<T> Optional<ComponentDescriptor<T>> findDescriptorByClass(Class<T> type)
Finds aComponentDescriptor
for the specified type.- Type Parameters:
T
- the component type.- Parameters:
type
- the component class.- Returns:
- the optional
ComponentDescriptor
instance. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.
-
findDescriptorByClass
<T> Optional<ComponentDescriptor<T>> findDescriptorByClass(Class<T> type, Qualifier<T> qualifier)
Finds aComponentDescriptor
for the specified type and options.- Type Parameters:
T
- the component type.- Parameters:
type
- the fully qualified class name or an alias of the component.qualifier
- the options used to qualified the component.- Returns:
- the optional
ComponentDescriptor
instance. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.
-
registerDescriptor
<T> void registerDescriptor(ComponentDescriptor<T> descriptor)
Registers the specifiedComponentDescriptor
to thisComponentRegistry
.- Type Parameters:
T
- the component type.- Parameters:
descriptor
- theComponentDescriptor
instance to be registered.- Throws:
ConflictingComponentDefinitionException
- if a component is already register for that descriptor.
-
-