Package de.hybris.platform.persistence
Class ManagerEJB
java.lang.Object
de.hybris.platform.persistence.ManagerEJB
- Direct Known Subclasses:
EnumerationManagerEJB,ExtensionEJB,ExtensionManagerEJB,LinkManagerEJB,MetaInformationManagerEJB,TypeManagerEJB
Default abstract class for implementing a Manager. A Manager in the hybris platform is a session bean that provides
methods for handling one or more types of 'Items'.
Handling means
For example a ProductManager is responsible for creating/removing and searching Products.
Additional each manager has to implement methods which are called by the system (the NotifyManager) if a item is removed or the system is initialized.
Handling means
- Creating items
- Removing items
- Perfom rollback/commit on stageable items
- Search specified items
For example a ProductManager is responsible for creating/removing and searching Products.
Additional each manager has to implement methods which are called by the system (the NotifyManager) if a item is removed or the system is initialized.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRemoveItem(ItemRemote item) In case a manager wants to abort the removal of an Item this method should return false.voidDefault implementation of EJB method.voidDefault implementation of EJB method.protected PersistencePoolbooleanisReinitialization(Map params) voidnotifyItemRemove(ItemRemote item) Callback method to get notified if an item in the hybris platform is going to be removed.voidprepareItemRemove(ItemRemote item) Called before a not stageable item is removed.voidremoveItem(ItemRemote item) Removes an Item which is not stageable.
-
Constructor Details
-
ManagerEJB
public ManagerEJB()
-
-
Method Details
-
getPersistencePool
-
notifyItemRemove
Callback method to get notified if an item in the hybris platform is going to be removed.
Each manager can perform some cleanups.
It is a major failure to throw an exception here to abort item removal; usecanRemoveItem(ItemRemote)instead to signal your veto. -
canRemoveItem
In case a manager wants to abort the removal of an Item this method should return false. Since all manager are asked before you can assume that no changes are made when one manager aborts.- Throws:
ConsistencyCheckException- you can either throw an exception or return false
-
isReinitialization
-
removeItem
Removes an Item which is not stageable. The following tasks are done by this method:- Check if item is stageable; if it is, throw exception (we can
- call
prepareItemRemove(ItemRemote) - Depending on the given stagingMethod do:
Productive Stage - Remove staged copy (item.getStagedCopy()) of item, if it exist
- call NotifyManager.notifyItemRemove( item )
- Remove the entity
- Remove staged copy (item.getStagedCopy()) of item, if it exist
- Mark item as removed (item.setRemoved(true)
- Throws:
ConsistencyCheckException- See Also:
-
prepareItemRemove
Called before a not stageable item is removed. This is a default implementation and can be overridden by subclasses to provide consistency checks.- Throws:
ConsistencyCheckException- See Also:
-
ejbCreate
public void ejbCreate()Default implementation of EJB method.
Each manager have to provide a non parameter create-method. This implementation just returns and does nothing. -
ejbPostCreate
public void ejbPostCreate()Default implementation of EJB method.
Each manager have to provide a non parameter postCreate-method. This implementation just returns and does nothing.
-