Class PlexusTypeRegistry


  • final class PlexusTypeRegistry
    extends java.lang.Object
    Enhanced Plexus component map with additional book-keeping.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String addComponent​(java.lang.String role, java.lang.String hint, java.lang.String instantiationStrategy, java.lang.String description, java.lang.String implementation)
      Registers the given component, automatically disambiguating between implementations bound multiple times.
      private DeferredClass<?> cloneImplementation​(java.lang.String implementation)
      Clones an implementation so it can be bound again with different configuration.
      (package private) java.util.Map<org.codehaus.plexus.component.annotations.Component,​DeferredClass<?>> getComponents()  
      (package private) ClassSpace getSpace()  
      (package private) void loadOnStart​(java.lang.String role, java.lang.String hint)
      Records that the given Plexus component should be loaded when the container starts.
      private java.lang.Class<?> loadRole​(java.lang.String role, java.lang.String implementation)
      Attempts to load the given Plexus role, checks constructors for concrete types.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOAD_ON_START_PLACEHOLDER

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

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

        private final java.util.Map<java.lang.String,​DeferredClass<?>> implementations
      • deferredNames

        private final java.util.Set<java.lang.String> deferredNames
    • Constructor Detail

      • PlexusTypeRegistry

        PlexusTypeRegistry​(ClassSpace space)
    • Method Detail

      • getSpace

        ClassSpace getSpace()
        Returns:
        Current class space
      • loadOnStart

        void loadOnStart​(java.lang.String role,
                         java.lang.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

        java.lang.String addComponent​(java.lang.String role,
                                      java.lang.String hint,
                                      java.lang.String instantiationStrategy,
                                      java.lang.String description,
                                      java.lang.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

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

        private java.lang.Class<?> loadRole​(java.lang.String role,
                                            java.lang.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​(java.lang.String implementation)
        Clones an implementation so it can be bound again with different configuration.
        Parameters:
        implementation - The implementation
        Returns:
        Cloned implementation