Class AbstractThreadSafeComponentExtensionPoint<T>
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint<T>
-
- Type Parameters:
T
- the type of the managed extensions
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<T>
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
,ThreadSafe
- Direct Known Subclasses:
AbstractClientSideExtensionPoint
,AbstractSelectorExtensionPoint
,AbstractTagProviderExtensionPoint
,AbstractThreadSafeComponentPrioritizableExtensionPoint
,AccessControllerExtensionPoint
,ActionExtensionPoint
,AdditionalPropertyIndexerExtensionPoint
,AdministratorNotificatorExtensionPoint
,AllowedUsersActionAdditionalOperationsExtensionPoint
,AmetysObjectFactoryExtensionPoint
,ApogeeExportExtensionPoint
,ApplicationGlyphManager
,ArchiverExtensionPoint
,AutomaticNewsletterExtensionPoint
,BackgroundEngineHookExtensionPoint
,BackOfficeRequestProxyExtensionPoint
,CatalogDataTypeExtensionPoint
,CategoryProviderExtensionPoint
,CDMfrExtensionPoint
,CDMFrSyncExtensionPoint
,ConfigParameterTypeExtensionPoint
,ContentAttributeTypeExtensionPoint
,ContentFilterExtensionPoint
,ContentImporterExtensionPoint
,ContentInputDataExtensionPoint
,ContentTypeExtensionPoint
,ContentVisibleAttachmentIndexerExtensionPoint
,CopyCatalogUpdaterExtensionPoint
,CopyUpdaterExtensionPoint
,CredentialProviderParameterTypeExtensionPoint
,DataSourceConsumerExtensionPoint
,DataSourceFactoryExtensionPoint
,DispatchProcessExtensionPoint
,DocbookUpdateHandlerExtensionPoint
,Document2ImagesConvertorPolicyExtensionPoint
,DocumentProviderExtensionPoint
,DynamicContentTypeDescriptorExtentionPoint
,DynamicInformationProviderExtensionPoint
,EqTDComputationModeExtensionPoint
,EventTypeExtensionPoint
,ExternalizableDataProviderExtensionPoint
,ExternalizableMetadataProviderExtensionPoint
,ExternalLogExtensionPoint
,FrontCacheableResourceExtensionPoint
,GDPRServicesExtensionPoint
,GetTokenExtensionPoint
,GroupDirectoryParameterTypeExtensionPoint
,HTMLUpdateHandlerExtensionPoint
,InitExtensionPoint
,InputDataExtensionPoint
,JdbcParameterTypeExtensionPoint
,JSASSResourceURIExtensionPoint
,LinkDataTypeExtensionPoint
,LivePopulatorExtensionPoint
,MBeanExtensionPoint
,ModelAwareBasicTypesExtensionPoint
,ModelLessBasicTypesExtensionPoint
,MonitoringExtensionPoint
,OaiSetExtensionPoint
,ObserverExtensionPoint
,OSEExportExtensionPoint
,PageDataTypeExtensionPoint
,PageElementCachePolicyExtensionPoint
,PageFilterExtensionPoint
,PageVisibleAttachmentIndexerExtensionPoint
,PipelineSerializerModelExtensionPoint
,PluginArchiverExtensionPoint
,PopulationConsumerExtensionPoint
,ProjectDataTypeExtensionPoint
,RemoteUrlExtensionPoint
,ReportExtensionPoint
,ResourceMetadataPopulatorExtensionPoint
,ReturnableExtensionPoint
,RibbonImportManager
,RichTextConfigurationExtensionPoint
,RightContextConvertorExtensionPoint
,RunnableExtensionPoint
,SassFunctionsProviderExtensionPoint
,SchedulableExtensionPoint
,SchedulableParameterTypeExtensionPoint
,SchemaDefinitionProviderExtensionPoint
,ScriptBindingExtensionPoint
,SearchableExtensionPoint
,SearchComponentExtensionPoint
,SearchModuleExtensionPoint
,SearchUIModelExtensionPoint
,ServiceExtensionPoint
,ServiceParameterTypeExtensionPoint
,SiteConfigurationExtensionPoint
,SiteDocumentProviderExtensionPoint
,SiteParameterTypeExtensionPoint
,SitePluginArchiverExtensionPoint
,SiteTypesExtensionPoint
,SkinParameterTypeExtensionPoint
,SQLDatabaseTypeExtensionPoint
,SupportedContextResourceUriExtensionPoint
,SurveyElementDataTypeExtensionPoint
,SynchronizeContentsCollectionModelExtensionPoint
,SynchronizingContentOperatorExtensionPoint
,SystemPropertyExtensionPoint
,TagTargetTypeExtensionPoint
,TaskAttributesTypeExtensionPoint
,TaskListAttributesTypeExtensionPoint
,TreeExtensionPoint
,UnversionedDataTypeExtensionPoint
,URIResolverExtensionPoint
,UserDirectoryParameterTypeExtensionPoint
,UserPreferencesExtensionPoint
,VersionHandlerExtensionPoint
,VersionStorageExtensionPoint
,ViewParameterTypeExtensionPoint
,WelcomeStepExtensionPoint
,WidgetsManager
,WorkflowDefinitionExtensionPoint
,WorkspaceModuleExtensionPoint
public abstract class AbstractThreadSafeComponentExtensionPoint<T> extends AbstractLogEnabled implements ExtensionPoint<T>, Component, ThreadSafe, Serviceable, Initializable, Disposable, Contextualizable
Avalon based implementation of an ExtensionPoint.
Subclasses only need to calladdComponent()
for each new extension.
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager
_cocoonManager
Avalon service managerprotected Context
_context
Avalon contextprotected ThreadSafeComponentManager<T>
_manager
Avalon ComponentManager
-
Constructor Summary
Constructors Constructor Description AbstractThreadSafeComponentExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 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.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_manager
protected ThreadSafeComponentManager<T> _manager
Avalon ComponentManager
-
_cocoonManager
protected ServiceManager _cocoonManager
Avalon service manager
-
-
Constructor Detail
-
AbstractThreadSafeComponentExtensionPoint
public AbstractThreadSafeComponentExtensionPoint()
-
-
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
-
addComponent
protected void addComponent(String pluginName, String featureName, String role, Class<? extends T> clazz, Configuration configuration) throws ComponentException
Adds a Component to the underlying ComponentManager. Each extension to this ExtensionPoint may be considered as a Component.- Parameters:
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 component- Throws:
ComponentException
- if an error occured whil setting up components
-
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
-
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
-
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
-
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
-
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
-
-