Class WAComponentRegistry
- java.lang.Object
-
- org.silverpeas.core.admin.component.WAComponentRegistry
-
- All Implemented Interfaces:
Initialization
@Service @Singleton public class WAComponentRegistry extends Object implements Initialization
A registry of Web Application Components available in Silverpeas. TheWAComponent
available in Silverpeas are defined by an XML descriptor located in theSILVERPEAS_HOME/xmlcomponents
directory. The descriptors that must satisfy the XSD component.xsd. The WAComponent instances are then constructed from their XML descriptor by the registry at initialization time so that they are available by the core component management service.- Author:
- mmoquillon
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WAComponentRegistry
get()
Gets an instance of this WAComponentRegistry registry.Map<String,WAComponent>
getAllWAComponents()
Gets all the registered WAComponent instances indexed by their name.Optional<WAComponent>
getWAComponent(String componentName)
Gets the WAComponent instance registered under the specified name.void
init()
Initializes some resources required by the services or performs some initialization processes at Silverpeas startup.void
putWorkflow(File xmlComponent)
void
putWorkflow(WAComponent waComponent)
Registers the specified workflow as a WAComponent so that it will be available among the instantiable applications in Silverpeas.void
removeWorkflow(WAComponent waComponent)
Removes from the registry the specified workflow application.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.initialization.Initialization
getPriority, release
-
-
-
-
Method Detail
-
get
public static WAComponentRegistry get()
Gets an instance of this WAComponentRegistry registry.- Returns:
- a WAComponentRegistry instance.
-
init
public void init() throws Exception
Initializes some resources required by the services or performs some initialization processes at Silverpeas startup.- Specified by:
init
in interfaceInitialization
- Throws:
Exception
- if an error occurs during the initialization process. In this case the Silverpeas startup fails.
-
getWAComponent
public Optional<WAComponent> getWAComponent(String componentName)
Gets the WAComponent instance registered under the specified name.- Parameters:
componentName
- the name of the Silverpeas component.- Returns:
- an optional WAComponent instance if such instance exists under the given name.
-
getAllWAComponents
public Map<String,WAComponent> getAllWAComponents()
Gets all the registered WAComponent instances indexed by their name.- Returns:
- a dictionary of the available WAComponent instances indexed by their name.
-
putWorkflow
public void putWorkflow(WAComponent waComponent)
Registers the specified workflow as a WAComponent so that it will be available among the instantiable applications in Silverpeas. (A workflow that is instantiated as an application instance is then taken in charge by the Silverpeas Workflow Engine.)- Parameters:
waComponent
- the WAComponent instance representing a workflow application.- Throws:
SilverpeasRuntimeException
- if the registration failed.
-
putWorkflow
public void putWorkflow(File xmlComponent)
-
removeWorkflow
public void removeWorkflow(WAComponent waComponent)
Removes from the registry the specified workflow application. Once removed, it will be no longer available among the instantiable applications in Silverpeas. If a such workflow application doesn't exist, nothing is done.- Parameters:
waComponent
- the WAComponent instance representing a workflow application.- Throws:
SilverpeasRuntimeException
- if the remove failed.
-
-