Class BridgeAbstraction
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Item
On of the main tasks of this class is to provide methods to set/get and remove transient objects. The main purpose
of this concept is to store information which is not meant to be made persistent. for example you can store the last visited
webpages in the JaloSession object.
Note: You cannot assume that a transient value assigned to a jalo object is still bound if you are not explicitly holding the reference of the jalo object. if you for example bind a value to a product with a specific PK and are using some finder method to get this product back, the value could be removed. this is because the internal jalo object cache could have been purged.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BridgeInterfacethe bridge implementation.protected Tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreturns the implementation object of this jalo bridge abstractionabstract ObjectgetTransientObject(String key) get a transient object.abstract MapReturns the Complete Map of transient objects.voidsets the implementation object of this jalo bridge abstraction.voidabstract voidsetTransientObject(String key, Object value) sets a transient object.
-
Field Details
-
impl
the bridge implementation.this variable is protected because of performance reasons. you can also use getImplementation(), but keep in mind, that every jalo method needs to call their relating implementation so we suggest to use 'impl'.
-
tenant
-
-
Constructor Details
-
BridgeAbstraction
public BridgeAbstraction()
-
-
Method Details
-
setImplementation
sets the implementation object of this jalo bridge abstraction.- Parameters:
impl- the BridgeInterface object
-
getTenant
-
setTenant
-
getImplementation
returns the implementation object of this jalo bridge abstraction- Returns:
- the implementation object of this jalo bridge abstraction
-
setTransientObject
sets a transient object.the value will be mapped to this object until
- it will be removed with
setTransientObject(key,null) - or the garbage collector will remove this BridgeAbstraction.
- Parameters:
key- the keyvalue- may be null; this will remove the transient object mapping
- it will be removed with
-
getTransientObject
get a transient object.a
nullis returned if no transient object is mapped to the given key.- Parameters:
key-
-
getTransientObjectMap
Returns the Complete Map of transient objects.Note: Changes are directly reflected to the BridgeAbstraction object. The returned map is bound to the object. So be careful when modifying the map.
-