Package org.eclipse.sisu.plexus
Class PlexusTypeRegistry
- java.lang.Object
-
- org.eclipse.sisu.plexus.PlexusTypeRegistry
-
final class PlexusTypeRegistry extends java.lang.Object
Enhanced Plexus component map with additional book-keeping.
-
-
Field Summary
Fields Modifier and Type Field Description private CloningClassSpace
clones
private java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Component>
components
private java.util.Set<java.lang.String>
deferredNames
private java.util.Map<java.lang.String,DeferredClass<?>>
implementations
private static org.codehaus.plexus.component.annotations.Component
LOAD_ON_START_PLACEHOLDER
private ClassSpace
space
-
Constructor Summary
Constructors Constructor Description PlexusTypeRegistry(ClassSpace space)
-
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.
-
-
-
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
-
space
private final ClassSpace space
-
clones
private CloningClassSpace clones
-
-
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 rolehint
- 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 rolehint
- The Plexus hintinstantiationStrategy
- The instantiation strategydescription
- The component descriptionimplementation
- 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 roleimplementation
- 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
-
-