Class ToolRegistry

  • All Implemented Interfaces:
    Initialization

    @Service
    @Singleton
    public class ToolRegistry
    extends Object
    implements Initialization
    A registry of tools available in Silverpeas.

    The Tool available in Silverpeas are defined by a simple property file.
    Author:
    silveryocha
    • Method Detail

      • get

        public static ToolRegistry get()
        Gets an instance of this ToolRegistry registry.
        Returns:
        a ToolRegistry 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.
      • getTool

        public Optional<Tool> getTool​(String toolId)
        Gets the Tool instance registered under the specified id.
        Parameters:
        toolId - the id (or the id) of the tool.
        Returns:
        an optional Tool instance if such instance exists under the given id.
      • getAllTools

        public Map<String,​Tool> getAllTools()
        Gets all the registered Tool instances indexed by their id.
        Returns:
        a dictionary of the available Tool instances indexed by their id.