Class PlexusTypeRegistry

java.lang.Object
org.eclipse.sisu.plexus.PlexusTypeRegistry

final class PlexusTypeRegistry extends Object
Enhanced Plexus component map with additional book-keeping.
  • Field Details

    • LOAD_ON_START_PLACEHOLDER

      private static final org.codehaus.plexus.component.annotations.Component LOAD_ON_START_PLACEHOLDER
    • components

      private final Map<String,org.codehaus.plexus.component.annotations.Component> components
    • implementations

      private final Map<String,DeferredClass<?>> implementations
    • deferredNames

      private final Set<String> deferredNames
    • space

      private final ClassSpace space
    • clones

      private CloningClassSpace clones
  • Constructor Details

    • PlexusTypeRegistry

      PlexusTypeRegistry(ClassSpace space)
  • Method Details

    • getSpace

      ClassSpace getSpace()
      Returns:
      Current class space
    • loadOnStart

      void loadOnStart(String role, String hint)
      Records that the given Plexus component should be loaded when the container starts.
      Parameters:
      role - The Plexus role
      hint - The Plexus hint
    • addComponent

      String addComponent(String role, String hint, String instantiationStrategy, String description, String implementation)
      Registers the given component, automatically disambiguating between implementations bound multiple times.
      Parameters:
      role - The Plexus role
      hint - The Plexus hint
      instantiationStrategy - The instantiation strategy
      description - The component description
      implementation - The implementation
      Returns:
      The implementation the component was successfully registered with; otherwise null
    • getComponents

      Map<org.codehaus.plexus.component.annotations.Component,DeferredClass<?>> getComponents()
      Returns:
      Plexus component map
    • loadRole

      private Class<?> loadRole(String role, String implementation)
      Attempts to load the given Plexus role, checks constructors for concrete types.
      Parameters:
      role - The Plexus role
      implementation - The implementation
      Returns:
      Loaded Plexus role
    • cloneImplementation

      private DeferredClass<?> cloneImplementation(String implementation)
      Clones an implementation so it can be bound again with different configuration.
      Parameters:
      implementation - The implementation
      Returns:
      Cloned implementation