Interface ComponentFactory
-
- All Superinterfaces:
AutoCloseable
,Closeable
,ComponentDescriptorRegistry
,ComponentRegistry
- All Known Implementing Classes:
ContextAwareComponentFactory
,DefaultComponentFactory
public interface ComponentFactory extends ComponentRegistry, ComponentDescriptorRegistry, Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> boolean
containsComponent(Class<T> type)
Checks whether a components is already registered for the specified class.<T> boolean
containsComponent(Class<T> type, Qualifier<T> qualifier)
Checks whether a components is already registered for the specified type and scope.boolean
containsComponent(String type)
Checks whether the specified components class or alias is already registered.<T> boolean
containsComponent(String type, Qualifier<T> qualifier)
Checks whether a components is already registered for the specified type and scope.<T> Collection<GettableComponent<T>>
getAllComponents(Class<T> type, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.<T> Collection<T>
getAllComponents(Class<T> type, Conf conf)
Gets all instances, which may be shared or independent, for the specified type.<T> Collection<T>
getAllComponents(Class<T> type, Conf conf, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.<T> Collection<T>
getAllComponents(String type, Conf conf)
Gets all instances, which may be shared or independent, for the specified type.<T> Collection<T>
getAllComponents(String type, Conf conf, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.<T> GettableComponent<T>
getComponent(Class<T> type, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.<T> T
getComponent(Class<T> type, Conf conf)
Gets an instance, which may be shared or independent, for the specified type.<T> T
getComponent(Class<T> type, Conf conf, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.<T> T
getComponent(String type, Conf conf)
Gets an instance, which may be shared or independent, for the specified type.<T> T
getComponent(String type, Conf conf, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.-
Methods inherited from interface io.streamthoughts.azkarra.api.components.ComponentDescriptorRegistry
findAllDescriptorsByAlias, findAllDescriptorsByAlias, findAllDescriptorsByClass, findAllDescriptorsByClass, findDescriptorByAlias, findDescriptorByAlias, findDescriptorByClass, findDescriptorByClass, registerDescriptor
-
Methods inherited from interface io.streamthoughts.azkarra.api.components.ComponentRegistry
registerComponent, registerComponent, registerComponent, registerComponent, registerSingleton, registerSingleton, registerSingleton, registerSingleton, registerSingleton
-
-
-
-
Method Detail
-
containsComponent
boolean containsComponent(String type)
Checks whether the specified components class or alias is already registered.- Parameters:
type
- the fully qualified class name or an alias of the component.- Returns:
true
if a provider exist,false
otherwise.
-
containsComponent
<T> boolean containsComponent(String type, Qualifier<T> qualifier)
Checks whether a components is already registered for the specified type and scope.- Parameters:
type
- the component type.qualifier
- the options to qualified the component.- Returns:
true
if a provider exist,false
otherwise.
-
containsComponent
<T> boolean containsComponent(Class<T> type)
Checks whether a components is already registered for the specified class.- Parameters:
type
- the component type.- Returns:
true
if a provider exist,false
otherwise.
-
containsComponent
<T> boolean containsComponent(Class<T> type, Qualifier<T> qualifier)
Checks whether a components is already registered for the specified type and scope.- Parameters:
type
- the component type.qualifier
- the options to qualified the component.- Returns:
true
if a provider exist,false
otherwise.
-
getComponent
<T> T getComponent(Class<T> type, Conf conf)
Gets an instance, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.conf
- the configuration used if the component implementConfigurable
.- Returns:
- the instance of type
ComponentFactory
. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.NoSuchComponentException
- if no component is registered for the given type.
-
getComponent
<T> T getComponent(Class<T> type, Conf conf, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.conf
- the configuration used if the component implementConfigurable
.qualifier
- the options used to qualify the component.- Returns:
- the instance of type
ComponentFactory
. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.NoSuchComponentException
- if no component is registered for the given type.
-
getComponent
<T> GettableComponent<T> getComponent(Class<T> type, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.qualifier
- the options used to qualified the component.- Returns:
- the instance of type
ComponentFactory
. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.NoSuchComponentException
- if no component is registered for the given type.
-
getComponent
<T> T getComponent(String type, Conf conf)
Gets an instance, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the fully qualified class name or an alias of the component.conf
- the configuration used if the component implementConfigurable
.- Returns:
- the instance of type
ComponentFactory
. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.NoSuchComponentException
- if no component is registered for the given class or alias..
-
getComponent
<T> T getComponent(String type, Conf conf, Qualifier<T> qualifier)
Gets an instance, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the fully qualified class name or an alias of the component.conf
- the configuration used if the component implementConfigurable
.qualifier
- the options used to qualify the component.- Returns:
- the instance of type
ComponentFactory
. - Throws:
NoUniqueComponentException
- if more than one component is registered for the given type.NoSuchComponentException
- if no component is registered for the given class or alias..
-
getAllComponents
<T> Collection<T> getAllComponents(String type, Conf conf)
Gets all instances, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the fully qualified class name or an alias of the component.conf
- the configuration used if the component implementConfigurable
.- Returns:
- all instances of type
ComponentFactory
.
-
getAllComponents
<T> Collection<T> getAllComponents(String type, Conf conf, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the fully qualified class name or an alias of the component.conf
- the configuration used if the component implementConfigurable
.qualifier
- the options used to qualify the component.- Returns:
- all instances of type
ComponentFactory
.
-
getAllComponents
<T> Collection<T> getAllComponents(Class<T> type, Conf conf)
Gets all instances, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.conf
- the configuration used if the component implementConfigurable
.- Returns:
- all instances of type
ComponentFactory
.
-
getAllComponents
<T> Collection<T> getAllComponents(Class<T> type, Conf conf, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.conf
- the configuration used if the component implementConfigurable
.qualifier
- the options used to qualify the component.- Returns:
- all instances of type
ComponentFactory
.
-
getAllComponents
<T> Collection<GettableComponent<T>> getAllComponents(Class<T> type, Qualifier<T> qualifier)
Gets all instances, which may be shared or independent, for the specified type.- Type Parameters:
T
- the component-type.- Parameters:
type
- the component class.qualifier
- the options used to qualify the component.- Returns:
- all instances of type
ComponentFactory
.
-
-