Class BridgeAbstraction

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Item

    public abstract class BridgeAbstraction
    extends java.lang.Object
    implements java.io.Serializable
    the 'father' of all Jalo Items and Managers.

    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:
    Serialized Form
    • Field Detail

      • impl

        protected BridgeInterface 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

        protected Tenant tenant
    • Constructor Detail

      • BridgeAbstraction

        public BridgeAbstraction()
    • Method Detail

      • setImplementation

        public void setImplementation​(BridgeInterface impl)
        sets the implementation object of this jalo bridge abstraction.
        Parameters:
        impl - the BridgeInterface object
      • getTenant

        public Tenant getTenant()
      • setTenant

        public void setTenant​(Tenant tenant)
      • getImplementation

        public BridgeInterface getImplementation()
        returns the implementation object of this jalo bridge abstraction
        Returns:
        the implementation object of this jalo bridge abstraction
      • setTransientObject

        public abstract void setTransientObject​(java.lang.String key,
                                                java.lang.Object value)
        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 key
        value - may be null; this will remove the transient object mapping
      • getTransientObject

        public abstract java.lang.Object getTransientObject​(java.lang.String key)
        get a transient object.

        a null is returned if no transient object is mapped to the given key.

        Parameters:
        key -
      • getTransientObjectMap

        public abstract java.util.Map 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.