public abstract class Manager extends Object implements Serializable
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.
do not use it anymore! see PLA-10102
|
protected SessionContext |
getAllValuesSessionContext(SessionContext ctx)
creates a session context instance for getting all localized property values using
LocalizableItem.getLocalizedProperty(SessionContext, String).
|
Object |
getAttribute(String key)
get a session attribute.
|
Map |
getAttributeMap()
Returns the Complete Map of transient objects.
|
Item |
getFirstItemByAttribute(Class itemClass,
String attr,
Object attrVal)
Returns the first found Item of a given class which matches a given Attributevalue.
|
Item |
getFirstItemByAttribute(String attr,
Object attrVal,
Class itemClass)
Deprecated.
please use getFirstItemByAttribute(Class,String,Object)
|
ManagerEJB |
getRemote() |
Class |
getRemoteManagerClass() |
JaloSession |
getSession()
returns the assigned session.
|
static <T> T |
getSingletonManagerInstance(Class<T> clazz,
String extName)
Deprecated.
|
Tenant |
getTenant() |
Object |
getTransientObject(String key)
Deprecated.
please use #getAttribute(String) instead.
|
Map |
getTransientObjectMap()
Deprecated.
please use getAttributeMap instead.
|
void |
init()
Deprecated.
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(String key,
Object value)
add an attribute to this object.
|
void |
setTenant(Tenant tenant) |
void |
setTransientObject(String key,
Object value)
Deprecated.
please use setAttribute(String,Object) instead.
|
Object |
unwrap(Object object) |
Object |
unwrap(Object object,
boolean itemsAsPropertyValue) |
Object |
wrap(Object object) |
abstract 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 errorspublic void setAttribute(String key, 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(String key, Object value)
public Object getAttribute(String key)
a null is returned if no attribute is mapped to the given key.
key - @Deprecated public Object getTransientObject(String key)
public 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 Map getTransientObjectMap()
public Item getFirstItemByAttribute(Class itemClass, String attr, Object attrVal)
itemClass - The class of the Itemattr - The AttributeattrVal - The Value of the Attribute to compare@Deprecated public Item getFirstItemByAttribute(String attr, Object attrVal, Class itemClass)
public ManagerEJB getRemote()
public Class getRemoteManagerClass()
@Deprecated public static <T> T getSingletonManagerInstance(Class<T> clazz, String extName)
public abstract Object writeReplace() throws ObjectStreamException
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
ctx - 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 © 2017 SAP SE. All Rights Reserved.