public abstract class Manager extends java.lang.Object implements java.io.Serializable, ItemLifecycleListener
Each manager is assigned to a JaloSession and has via the getSession() method access to it.
| Modifier and Type | Class and Description |
|---|---|
static class |
Manager.GenericManagerSingletonCreator |
static class |
Manager.ManagerSingletonCreator |
| Constructor and Description |
|---|
Manager()
Warning: Never call the constructor of any manager directly.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterItemCreation(SessionContext ctx,
ComposedType type,
Item createdItem,
Item.ItemAttributeMap attributes)
This method will be called after an item was created.
|
void |
beforeItemCreation(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap attributes)
This method will be called before an item is created BUT AFTER the default values of this type are assigned
|
protected void |
checkBeforeItemRemoval(SessionContext ctx,
Item item)
TODO improve API doc Override this method to implement pre-removal consistency checks.
|
void |
destroy()
Deprecated.
since ages - do not use it anymore! see PLA-10102
|
protected <T extends ItemRemote> |
extractNonRequiredRemoteFromItem(Item item) |
protected <T extends ItemRemote> |
extractRequiredRemoteFromItem(Item item,
java.lang.Class<T> clazz) |
protected SessionContext |
getAllValuesSessionContext(SessionContext ctx)
creates a session context instance for getting all localized property values using
LocalizableItem.getLocalizedProperty(SessionContext, String).
|
java.lang.Object |
getAttribute(java.lang.String key)
get a session attribute.
|
java.util.Map |
getAttributeMap()
Returns the Complete Map of transient objects.
|
Item |
getFirstItemByAttribute(java.lang.Class itemClass,
java.lang.String attr,
java.lang.Object attrVal)
Returns the first found Item of a given class which matches a given Attributevalue.
|
Item |
getFirstItemByAttribute(java.lang.String attr,
java.lang.Object attrVal,
java.lang.Class itemClass)
Deprecated.
since ages - please use getFirstItemByAttribute(Class,String,Object)
|
ManagerEJB |
getRemote() |
java.lang.Class |
getRemoteManagerClass() |
JaloSession |
getSession()
returns the assigned session.
|
static <T> T |
getSingletonManagerInstance(java.lang.Class<T> clazz,
java.lang.String extName)
Deprecated.
since ages
|
Tenant |
getTenant() |
java.lang.Object |
getTransientObject(java.lang.String key)
Deprecated.
since ages - please use #getAttribute(String) instead.
|
java.util.Map |
getTransientObjectMap()
Deprecated.
since ages - please use getAttributeMap instead.
|
void |
init()
Deprecated.
since ages - do not use it anymore! see PLA-10102
|
protected void |
notifyItemRemoval(SessionContext ctx,
Item item)
TODO improve API doc Is called just before a item is being removed.
|
void |
setAttribute(java.lang.String key,
java.lang.Object value)
add an attribute to this object.
|
void |
setTenant(Tenant tenant) |
void |
setTransientObject(java.lang.String key,
java.lang.Object value)
Deprecated.
since ages - please use setAttribute(String,Object) instead.
|
java.lang.Object |
wrap(java.lang.Object object) |
abstract java.lang.Object |
writeReplace() |
public Manager()
@Deprecated public void init()
@Deprecated public void destroy()
public void setTenant(Tenant tenant)
public Tenant getTenant()
protected SessionContext getAllValuesSessionContext(SessionContext ctx)
the created session context simply doesnt have a language.
use it as follows:
public Map myMethod( SessionContext ctx )
{
...
return (Map)this.getLocalizedProperty(
getAllValuesSessionContext(ctx),
"theKey"
);
}
ctx - the original session contexpublic JaloSession getSession()
This is a very powerful method, it allows all items to gain access to the assigned JaloSession.
protected void notifyItemRemoval(SessionContext ctx, Item item)
checkBeforeItemRemoval(SessionContext, Item) instead.
This method does nothing and may be overridden.
ctx - the currency session contextitem - the item which is going to be removedprotected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
Manager and allows aborting removal by throwing a ConsistencyCheckException. If no manager
did so each one is notified by calling notifyItemRemoval(SessionContext, Item).
This method does nothing and may be overridden.
ctx - the current session contextitem - the item which should be removedConsistencyCheckException - thrown to abort removal due to consistency errorsprotected final <T extends ItemRemote> T extractRequiredRemoteFromItem(Item item, java.lang.Class<T> clazz)
protected final <T extends ItemRemote> T extractNonRequiredRemoteFromItem(Item item)
public void setAttribute(java.lang.String key,
java.lang.Object value)
the value will be mapped to this object until
setAttribute(key,null)
key - the keyvalue - may be null; this will remove the transient object mapping@Deprecated
public void setTransientObject(java.lang.String key,
java.lang.Object value)
public java.lang.Object getAttribute(java.lang.String key)
a null is returned if no attribute is mapped to the given key.
key - @Deprecated public java.lang.Object getTransientObject(java.lang.String key)
public java.util.Map getAttributeMap()
Note: Changes are directly reflected to the BridgeAbstraction object. The returned map is bound to the object. So be careful when modifying the map.
@Deprecated public java.util.Map getTransientObjectMap()
public Item getFirstItemByAttribute(java.lang.Class itemClass, java.lang.String attr, java.lang.Object attrVal)
itemClass - The class of the Itemattr - The AttributeattrVal - The Value of the Attribute to compare@Deprecated public Item getFirstItemByAttribute(java.lang.String attr, java.lang.Object attrVal, java.lang.Class itemClass)
public ManagerEJB getRemote()
public java.lang.Class getRemoteManagerClass()
@Deprecated
public static <T> T getSingletonManagerInstance(java.lang.Class<T> clazz,
java.lang.String extName)
public java.lang.Object wrap(java.lang.Object object)
public abstract java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamExceptionpublic void beforeItemCreation(SessionContext ctx, ComposedType type, Item.ItemAttributeMap attributes) throws JaloBusinessException
ctx - the currency session contexttype - the type of the item which will be createdattributes - the attribute values to be used for creationJaloBusinessException
This method does nothing and may be overridden.
CAUTION: This method will be called inside a transaction !!!
public void afterItemCreation(SessionContext ctx, ComposedType type, Item createdItem, Item.ItemAttributeMap attributes) throws JaloBusinessException
afterItemCreation in interface ItemLifecycleListenerctx - the currency session contexttype - the type of the item which will be createdcreatedItem - the created itemJaloBusinessException
This method does nothing and may be overridden.
CAUTION: This method will be called inside a transaction !!!
Copyright © 2018 SAP SE. All Rights Reserved.