Interface Component<C>
- Type Parameters:
C- The type of component.
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
AbstractComponent,InstantiatedComponentDefinition,LazyInitializedComponentDefinition
Describes a component defined in a
Configuration, that may depend on other component for its initialization
or during it's startup/shutdown operations.
Note: This interface is not expected to be used outside of Axon Framework!
- Since:
- 3.0.0
- Author:
- Allard Buijze, Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA tuple representing aComponent'suniqueness, consisting out of atypeandname. -
Method Summary
Modifier and TypeMethodDescriptionThe identifier of this component.voidinitLifecycle(Configuration configuration, LifecycleRegistry lifecycleRegistry) Initializes the lifecycle handlers associated with this component.booleanIndicates whether theinitLifecycle(Configuration, LifecycleRegistry)method has already been invoked for this component.booleanIndicates whether the component has beenresolved.resolve(Configuration configuration) Resolves the instance of this component, allowing it to retrieve any of its required dependencies from the givenconfiguration.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
identifier
Component.Identifier<C> identifier()The identifier of this component.- Returns:
- The identifier of this component.
-
resolve
Resolves the instance of this component, allowing it to retrieve any of its required dependencies from the givenconfiguration.Subsequent calls to this method will result in the same instance, even when different instances of
configurationare provided.- Parameters:
configuration- The configuration that declared this component.- Returns:
- The resolved instance defined in this component.
-
isInstantiated
boolean isInstantiated()Indicates whether the component has beenresolved.When true, any subsequent call to
resolve(Configuration)will return that same instance.- Returns:
trueif the component has been instantiated, otherwisefalse.
-
initLifecycle
void initLifecycle(@Nonnull Configuration configuration, @Nonnull LifecycleRegistry lifecycleRegistry) Initializes the lifecycle handlers associated with this component.Subsequent calls to this method will not result in additional invocations of the lifecycle handlers registered with this component.
- Parameters:
configuration- The configuration in which the component was defined, allowing retrieval of dependencies during the component's lifecycle.lifecycleRegistry- The registry in which to register the lifecycle handlers.
-
isInitialized
boolean isInitialized()Indicates whether theinitLifecycle(Configuration, LifecycleRegistry)method has already been invoked for this component.- Returns:
trueif the component's lifecycle has been initialized, otherwisefalse.
-