Class ExtensionManager

java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.extension.ExtensionManager
All Implemented Interfaces:
ItemLifecycleListener, Serializable

public class ExtensionManager extends Manager
The manager for handling hybris Platform extensions.

See Also:
  • Field Details

  • Constructor Details

    • ExtensionManager

      public ExtensionManager()
  • Method Details

    • getRemoteManagerClass

      public Class getRemoteManagerClass()
      Overrides:
      getRemoteManagerClass in class Manager
    • getInstance

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

      protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
      Overrides:
      checkBeforeItemRemoval in class Manager
      Parameters:
      ctx - the current session context
      item - the item which should be removed
      Throws:
      ConsistencyCheckException - thrown to abort removal due to consistency errors
      Since:
      2.10
    • notifyItemRemoval

      protected void notifyItemRemoval(SessionContext ctx, Item item)
      Overrides:
      notifyItemRemoval in class Manager
      Parameters:
      ctx - the currency session context
      item - the item which is going to be removed
      Since:
      2.10
    • getExtension

      public Extension getExtension(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 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 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 List<? extends Extension> loadAllExtensions()
    • isExtensionInstalled

      public boolean isExtensionInstalled(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
    • notifyOnFirstSessionCreation

      public void notifyOnFirstSessionCreation()
      Calls for each extension the Extension.onFirstSessionCreation() once at startup.
    • writeReplace

      public Object writeReplace() throws ObjectStreamException
      Specified by:
      writeReplace in class Manager
      Throws:
      ObjectStreamException