Class ExtensionManager
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.extension.ExtensionManager
-
- All Implemented Interfaces:
ItemLifecycleListener,java.io.Serializable
public class ExtensionManager extends Manager
The manager for handling hybris Platform extensions.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classExtensionManager.ExtensionManagerSerializableDTO-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAME
-
Constructor Summary
Constructors Constructor Description ExtensionManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckBeforeItemRemoval(SessionContext ctx, Item item)Delegates call toManager.checkBeforeItemRemoval(SessionContext, Item)to allextensions.ExtensiongetExtension(java.lang.String extName)Finds an extension by its name.java.util.CollectiongetExtensionNames()The list of all installed extensions
Note This method will not check, if the extensions are properly installed, thus usinggetExtension(String)with on of the returned Extension names can throw an Exception.java.util.List<? extends Extension>getExtensions()Return all extensions.static ExtensionManagergetInstance()returns an instance of the ExtensionManagerjava.lang.ClassgetRemoteManagerClass()booleanisExtensionInstalled(java.lang.String name)Checks whether a given extension is installed in the system.protected java.util.List<? extends Extension>loadAllExtensions()protected voidnotifyItemRemoval(SessionContext ctx, Item item)Delegates call toManager.notifyItemRemoval(SessionContext, Item)to allextensions.voidnotifyOnFirstSessionCreation()Calls for each extension theExtension.onFirstSessionCreation()once at startup.java.lang.ObjectwriteReplace()-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Field Detail
-
BEAN_NAME
public static final java.lang.String BEAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRemoteManagerClass
public java.lang.Class getRemoteManagerClass()
- Overrides:
getRemoteManagerClassin classManager
-
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
Delegates call toManager.checkBeforeItemRemoval(SessionContext, Item)to allextensions.- Overrides:
checkBeforeItemRemovalin classManager- Parameters:
ctx- the current session contextitem- 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)
Delegates call toManager.notifyItemRemoval(SessionContext, Item)to allextensions.- Overrides:
notifyItemRemovalin classManager- Parameters:
ctx- the currency session contextitem- the item which is going to be removed- Since:
- 2.10
-
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 benull- Returns:
- The
Extensionobject.nullis 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 usinggetExtension(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
Extensionobjects.
-
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
-
notifyOnFirstSessionCreation
public void notifyOnFirstSessionCreation()
Calls for each extension theExtension.onFirstSessionCreation()once at startup.
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException- Specified by:
writeReplacein classManager- Throws:
java.io.ObjectStreamException
-
-