Package org.eclipse.sisu.plexus
Class PlexusTypeRegistry
java.lang.Object
org.eclipse.sisu.plexus.PlexusTypeRegistry
Enhanced Plexus component map with additional book-keeping.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CloningClassSpace
private final Map<String,
DeferredClass<?>> private static final org.codehaus.plexus.component.annotations.Component
private final ClassSpace
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) String
addComponent
(String role, String hint, String instantiationStrategy, String description, String implementation) Registers the given component, automatically disambiguating between implementations bound multiple times.private DeferredClass<?>
cloneImplementation
(String implementation) Clones an implementation so it can be bound again with different configuration.(package private) Map<org.codehaus.plexus.component.annotations.Component,
DeferredClass<?>> (package private) ClassSpace
getSpace()
(package private) void
loadOnStart
(String role, String hint) Records that the given Plexus component should be loaded when the container starts.private Class<?>
Attempts to load the given Plexus role, checks constructors for concrete types.
-
Field Details
-
LOAD_ON_START_PLACEHOLDER
private static final org.codehaus.plexus.component.annotations.Component LOAD_ON_START_PLACEHOLDER -
components
-
implementations
-
deferredNames
-
space
-
clones
-
-
Constructor Details
-
PlexusTypeRegistry
PlexusTypeRegistry(ClassSpace space)
-
-
Method Details
-
getSpace
ClassSpace getSpace()- Returns:
- Current class space
-
loadOnStart
Records that the given Plexus component should be loaded when the container starts.- Parameters:
role
- The Plexus rolehint
- 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 rolehint
- The Plexus hintinstantiationStrategy
- The instantiation strategydescription
- The component descriptionimplementation
- 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
Attempts to load the given Plexus role, checks constructors for concrete types.- Parameters:
role
- The Plexus roleimplementation
- The implementation- Returns:
- Loaded Plexus role
-
cloneImplementation
Clones an implementation so it can be bound again with different configuration.- Parameters:
implementation
- The implementation- Returns:
- Cloned implementation
-