T - the type of the managed extensionspublic abstract class AbstractThreadSafeComponentExtensionPoint<T> extends AbstractLogEnabled implements ExtensionPoint<T>, Component, ThreadSafe, Serviceable, Initializable, Disposable, Contextualizable
addComponent() for each new extension.| Modifier and Type | Field and Description |
|---|---|
protected ServiceManager |
_cocoonManager
Avalon service manager
|
protected Context |
_context
Avalon context
|
private Set<String> |
_ids |
protected ThreadSafeComponentManager<T> |
_manager
Avalon ComponentManager
|
| Constructor and Description |
|---|
AbstractThreadSafeComponentExtensionPoint() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(String pluginName,
String featureName,
String role,
Class<? extends T> clazz,
Configuration configuration)
Adds a Component to the underlying ComponentManager.
|
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 extension
|
Set<String> |
getExtensionsIds()
Returns a Set containing the ids of all known extensions
|
boolean |
hasExtension(String id)
Returns true if the named extension exists
|
void |
initialize() |
void |
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after all addExtension() calls.This is the last step before the actual startup of the application. |
void |
service(ServiceManager manager) |
getLogger, setLoggerprotected ThreadSafeComponentManager<T> _manager
protected ServiceManager _cocoonManager
public AbstractThreadSafeComponentExtensionPoint()
public void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic void initialize() throws Exception
initialize in interface InitializableExceptionpublic void dispose()
dispose in interface Disposableprotected void addComponent(String pluginName, String featureName, String role, Class<? extends T> clazz, Configuration configuration) throws ComponentException
pluginName - Unique identifier for the plugin hosting the extensionfeatureName - The feature name (unique for a given pluginName).role - the Avalon roleclazz - the class of the componentconfiguration - the configuration of the componentComponentException - if an error occured whil setting up componentspublic void initializeExtensions() throws Exception
ExtensionPointaddExtension() calls.initializeExtensions in interface ExtensionPoint<T>Exception - if something wrong occurspublic T getExtension(String id)
ExtensionPointgetExtension in interface ExtensionPoint<T>id - the unique id of the extensionpublic boolean hasExtension(String id)
ExtensionPointhasExtension in interface ExtensionPoint<T>id - the unique id of the extensionpublic void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
ExtensionPointaddExtension in interface ExtensionPoint<T>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 addedConfigurationException - when a configuration problem occurspublic Set<String> getExtensionsIds()
ExtensionPointgetExtensionsIds in interface ExtensionPoint<T>