Interface Component<C>

Type Parameters:
C - The type of component.
All Superinterfaces:
DescribableComponent
All Known Implementing Classes:
AbstractComponent, InstantiatedComponentDefinition, LazyInitializedComponentDefinition

public interface Component<C> extends DescribableComponent
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
  • Method Details

    • identifier

      Component.Identifier<C> identifier()
      The identifier of this component.
      Returns:
      The identifier of this component.
    • resolve

      C resolve(@Nonnull Configuration configuration)
      Resolves the instance of this component, allowing it to retrieve any of its required dependencies from the given configuration.

      Subsequent calls to this method will result in the same instance, even when different instances of configuration are 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 been resolved.

      When true, any subsequent call to resolve(Configuration) will return that same instance.

      Returns:
      true if the component has been instantiated, otherwise false.
    • 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 the initLifecycle(Configuration, LifecycleRegistry) method has already been invoked for this component.
      Returns:
      true if the component's lifecycle has been initialized, otherwise false.