Class WAComponentRegistry

  • All Implemented Interfaces:
    Initialization

    @Service
    @Singleton
    public class WAComponentRegistry
    extends Object
    implements Initialization
    A registry of Web Application Components available in Silverpeas.

    The WAComponent available in Silverpeas are defined by an XML descriptor located in the SILVERPEAS_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 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 interface Initialization
        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.