Class ExtensionManager

    • Constructor Detail

      • ExtensionManager

        public ExtensionManager()
    • Method Detail

      • getInstance

        public static ExtensionManager getInstance()
        returns an instance of the ExtensionManager
        Returns:
        instance of this manager
      • getExtension

        public Extension getExtension​(java.lang.String extName)
                               throws ExtensionNotFoundException
        Finds an extension by its name.
        Sample:
           Search search = (Search)ExtensionManager.getInstance().getExtension("search");
           SearchResult res = search.searchProducts( ... );
         
        Parameters:
        extName - the name of the extension, must not be null
        Returns:
        The Extension object. null is never returned by this method.
        Throws:
        ExtensionNotFoundException - if the extension cannot be found.
      • getExtensionNames

        public java.util.Collection getExtensionNames()
        The list of all installed extensions
        Note This method will not check, if the extensions are properly installed, thus using getExtension(String) with on of the returned Extension names can throw an Exception.
        Returns:
        a Collection of Strings with all extensionnames.
      • getExtensions

        public java.util.List<? extends Extension> getExtensions()
        Return all extensions.

        If one or more extensions which are configured but not properly installed (e.g. missing jar file), this method will not throw an exception. it simply removes the extension from the result.
        You can be sure that you can use all extensions you get from this method.

        Returns:
        a Collection of Extension objects.
      • loadAllExtensions

        protected java.util.List<? extends Extension> loadAllExtensions()
      • isExtensionInstalled

        public boolean isExtensionInstalled​(java.lang.String name)
        Checks whether a given extension is installed in the system.
        Parameters:
        name - - the name of the extension
        Returns:
        true, if the extension is installed, false otherwise
        Since:
        2.3
      • writeReplace

        public java.lang.Object writeReplace()
                                      throws java.io.ObjectStreamException
        Specified by:
        writeReplace in class Manager
        Throws:
        java.io.ObjectStreamException