Interface ComponentRegistry
-
- All Known Subinterfaces:
AzkarraContext,ComponentFactory
- All Known Implementing Classes:
ContextAwareComponentFactory,DelegatingComponentFactory
public interface ComponentRegistryTheComponentRegistryis the main interface for managing components used in an Azkarra application.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> voidregisterComponent(Class<T> componentClass, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type.default <T> voidregisterComponent(Class<T> componentClass, Supplier<T> supplier, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type.<T> voidregisterComponent(String componentName, Class<T> componentClass, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type and name.<T> voidregisterComponent(String componentName, Class<T> componentClass, Supplier<T> supplier, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type and name.default <T> voidregisterSingleton(Class<T> componentClass, ComponentDescriptorModifier... modifiers)Registers a singleton no-arg constructor component supplier for the specified type.default <T> voidregisterSingleton(Class<T> componentClass, Supplier<T> singleton, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type and name.<T> voidregisterSingleton(String componentName, Class<T> componentClass, ComponentDescriptorModifier... modifiers)Registers a singleton no-arg constructor component supplier for the specified type.<T> voidregisterSingleton(String componentName, Class<T> componentClass, Supplier<T> singleton, ComponentDescriptorModifier... modifiers)Registers the component supplier for the specified type and name.<T> voidregisterSingleton(T singleton)Register the specified shared instance.
-
-
-
Method Detail
-
registerComponent
default <T> void registerComponent(Class<T> componentClass, Supplier<T> supplier, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type.- Type Parameters:
T- the component-type.- Parameters:
componentClass- the class-type of the component.supplier- the supplier of the component.modifiers- the component descriptor modifiers.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerComponent
<T> void registerComponent(String componentName, Class<T> componentClass, Supplier<T> supplier, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type and name.- Type Parameters:
T- the component-type.- Parameters:
componentName- the name of the component.componentClass- the class-type of the component.supplier- the supplier of the component.modifiers- the component descriptor modifiers.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerComponent
default <T> void registerComponent(Class<T> componentClass, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type.- Type Parameters:
T- the component-type.- Parameters:
componentClass- the class-type of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerComponent
<T> void registerComponent(String componentName, Class<T> componentClass, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type and name.- Type Parameters:
T- the component-type.- Parameters:
componentName- the name of the component.componentClass- the class-type of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerSingleton
default <T> void registerSingleton(Class<T> componentClass, Supplier<T> singleton, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type and name. The given supplier will be used for creating a shared instance of typeComponentRegistry.- Type Parameters:
T- the component-type.- Parameters:
componentClass- the class-type of the component.singleton- the supplier of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerSingleton
<T> void registerSingleton(String componentName, Class<T> componentClass, Supplier<T> singleton, ComponentDescriptorModifier... modifiers)
Registers the component supplier for the specified type and name. The given supplier will be used for creating a shared instance of typeComponentRegistry.- Type Parameters:
T- the component-type.- Parameters:
componentName- the name of the component.componentClass- the class-type of the component.singleton- the supplier of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerSingleton
default <T> void registerSingleton(Class<T> componentClass, ComponentDescriptorModifier... modifiers)
Registers a singleton no-arg constructor component supplier for the specified type.- Type Parameters:
T- the component-type.- Parameters:
componentClass- the class-type of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerSingleton
<T> void registerSingleton(String componentName, Class<T> componentClass, ComponentDescriptorModifier... modifiers)
Registers a singleton no-arg constructor component supplier for the specified type.- Type Parameters:
T- the component-type.- Parameters:
componentName- the name of the component.componentClass- the class-type of the component.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
registerSingleton
<T> void registerSingleton(T singleton)
Register the specified shared instance.- Type Parameters:
T- the component-type.- Parameters:
singleton- the singleton component instance.- Throws:
ConflictingComponentDefinitionException- if a component is already register for that descriptor.
-
-