Class PluginsComponentManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.runtime.plugin.component.ThreadSafeComponentManager<Object>
-
- org.ametys.runtime.plugin.component.PluginsComponentManager
-
- All Implemented Interfaces:
LogEnabled
,Disposable
,Initializable
,ComponentManager
,Contextualizable
,Serviceable
public class PluginsComponentManager extends ThreadSafeComponentManager<Object> implements ComponentManager
Implementation of an Avalon ComponentManager handling the PluginAware and ParentAware interfaces.
See theThreadSafeComponentManager
for more details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PluginsComponentManager.ComponentInvocationHandler
private class
PluginsComponentManager.ExtensionPointFactory
private class
PluginsComponentManager.ProxyComponentFactory
-
Nested classes/interfaces inherited from class org.ametys.runtime.plugin.component.ThreadSafeComponentManager
ThreadSafeComponentManager.ComponentFactory
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,Collection<ExtensionDefinition>>
_extensionPoints
(package private) ComponentManager
_parentManager
-
Fields inherited from class org.ametys.runtime.plugin.component.ThreadSafeComponentManager
_componentsInitializing, _context, _manager
-
-
Constructor Summary
Constructors Constructor Description PluginsComponentManager(ComponentManager parentManager)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtensionPoint(String pluginName, String point, Class<? extends ExtensionPoint> extensionPoint, Configuration configuration, Collection<ExtensionDefinition> extensions)
Add a new extension point, and its extensions, to the manager.(package private) ThreadSafeComponentManager.ComponentFactory
getComponentFactory(String pluginName, String featureName, String role, Class<? extends Object> componentClass, Configuration configuration)
boolean
hasComponent(String role)
Component
lookup(String role)
Return an instance of a component based on a Role.void
release(Component object)
-
Methods inherited from class org.ametys.runtime.plugin.component.ThreadSafeComponentManager
_addComponent, addComponent, contextualize, dispose, hasComponent, hasRole, initialize, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_parentManager
ComponentManager _parentManager
-
_extensionPoints
private Map<String,Collection<ExtensionDefinition>> _extensionPoints
-
-
Constructor Detail
-
PluginsComponentManager
public PluginsComponentManager(ComponentManager parentManager)
Constructor.- Parameters:
parentManager
- the parent manager
-
-
Method Detail
-
hasComponent
public boolean hasComponent(String role)
- Specified by:
hasComponent
in interfaceComponentManager
-
lookup
public Component lookup(String role) throws ComponentException
Description copied from class:ThreadSafeComponentManager
Return an instance of a component based on a Role. The Role is usually the Interface Fully Qualified Name(FQN).- Specified by:
lookup
in interfaceComponentManager
- Overrides:
lookup
in classThreadSafeComponentManager<Object>
- Parameters:
role
- The key name of theComponent
to retrieve.- Returns:
- the desired component or null if no component exist for the given role
- Throws:
ComponentException
- if an error occurs
-
release
public void release(Component object)
- Specified by:
release
in interfaceComponentManager
-
addExtensionPoint
public void addExtensionPoint(String pluginName, String point, Class<? extends ExtensionPoint> extensionPoint, Configuration configuration, Collection<ExtensionDefinition> extensions)
Add a new extension point, and its extensions, to the manager.- Parameters:
pluginName
- the plugin containing the extension pointpoint
- the extension point name.extensionPoint
- the class of the extension point.configuration
- the configuration for the extension point.extensions
- definitions of extensions.
-
getComponentFactory
ThreadSafeComponentManager.ComponentFactory getComponentFactory(String pluginName, String featureName, String role, Class<? extends Object> componentClass, Configuration configuration)
- Overrides:
getComponentFactory
in classThreadSafeComponentManager<Object>
-
-