Class AbstractComponentExtensionPoint<T>
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.runtime.plugin.component.AbstractComponentExtensionPoint<T>
-
- Type Parameters:
T
- the type of the managed extensions
- All Implemented Interfaces:
ExtensionPoint<T>
,Disposable
,Initializable
,Component
,Contextualizable
,LogEnabled
,Serviceable
,ThreadSafe
- Direct Known Subclasses:
EnhancementHandlersExtensionPoint
,HTMLEditionHandlerExtensionPoint
,SitemapDecoratorsExtensionPoint
,SitemapIconsExtensionPoint
public abstract class AbstractComponentExtensionPoint<T> extends AbstractLogEnabled implements ExtensionPoint<T>, Component, ThreadSafe, Serviceable, Contextualizable, Initializable, Disposable
Avalon based implementation of an ExtensionPoint.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractComponentExtensionPoint.ExtensionConfiguration
This class is a storage for an extension informations
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
Avalon contextprotected Map<String,AbstractComponentExtensionPoint.ExtensionConfiguration>
_extensions
Extensions id and configuration associatedprotected ServiceManager
_manager
Avalon service manager
-
Constructor Summary
Constructors Constructor Description AbstractComponentExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtension(String id, String pluginName, String featureName, Configuration configuration)
Add an extension to this point.void
contextualize(Context context)
void
dispose()
T
getExtension(String id)
Returns the named extensionSet<String>
getExtensionsIds()
Returns a Set containing the ids of all known extensionsboolean
hasExtension(String id)
Returns true if the named extension existsvoid
initialize()
void
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.void
service(ServiceManager manager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
Avalon service manager
-
_extensions
protected Map<String,AbstractComponentExtensionPoint.ExtensionConfiguration> _extensions
Extensions id and configuration associated
-
-
Constructor Detail
-
AbstractComponentExtensionPoint
public AbstractComponentExtensionPoint()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
addExtension
public void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
Description copied from interface:ExtensionPoint
Add an extension to this point. Each implementation knows the meaning of the given configuration.- Specified by:
addExtension
in interfaceExtensionPoint<T>
- Parameters:
id
- the unique identifier of the extension.pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)configuration
- the information about the extension to be added- Throws:
ConfigurationException
- when a configuration problem occurs
-
getExtension
public T getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<T>
- Parameters:
id
- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPoint
Returns a Set containing the ids of all known extensions- Specified by:
getExtensionsIds
in interfaceExtensionPoint<T>
- Returns:
- a Set containing the ids of all known extensions
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPoint
Returns true if the named extension exists- Specified by:
hasExtension
in interfaceExtensionPoint<T>
- Parameters:
id
- the unique id of the extension- Returns:
- true if the named extension exists
-
initializeExtensions
public void initializeExtensions() throws Exception
Description copied from interface:ExtensionPoint
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.- Specified by:
initializeExtensions
in interfaceExtensionPoint<T>
- Throws:
Exception
- if something wrong occurs
-
-