Class Manager

    • Constructor Detail

      • Manager

        public Manager()
        Warning: Never call the constructor of any manager directly. Use the getInstance() method on each manager (e.g. ProductManager.getInstance()) to get the manager instance.
    • Method Detail

      • init

        @Deprecated
        public void init()
        Deprecated.
        since ages - do not use it anymore! see PLA-10102
        called once for each tenant, so this method fits best to perform some initialization stuff
      • destroy

        @Deprecated
        public void destroy()
        Deprecated.
        since ages - do not use it anymore! see PLA-10102
        called once for each tenant, so this method fits best to perform some cleanup stuff
      • setTenant

        public void setTenant​(Tenant tenant)
      • getTenant

        public Tenant getTenant()
      • getAllValuesSessionContext

        protected SessionContext getAllValuesSessionContext​(SessionContext ctx)
        creates a session context instance for getting all localized property values using LocalizableItem.getLocalizedProperty(SessionContext, String). the return value will be a map { Language -> Object }

        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"
                        );
                }
         
        Parameters:
        ctx - the original session contex
        Returns:
        a session context instance without a language set
      • getSession

        public JaloSession getSession()
        returns the assigned session.

        This is a very powerful method, it allows all items to gain access to the assigned JaloSession.

      • notifyItemRemoval

        protected void notifyItemRemoval​(SessionContext ctx,
                                         Item item)
        TODO improve API doc Is called just before a item is being removed. No exception should be thrown here. Use checkBeforeItemRemoval(SessionContext, Item) instead.

        This method does nothing and may be overridden.

        Parameters:
        ctx - the currency session context
        item - the item which is going to be removed
        Since:
        2.10
      • extractRequiredRemoteFromItem

        protected final <T extends ItemRemote> T extractRequiredRemoteFromItem​(Item item,
                                                                               java.lang.Class<T> clazz)
      • extractNonRequiredRemoteFromItem

        protected final <T extends ItemRemote> T extractNonRequiredRemoteFromItem​(Item item)
      • setAttribute

        public void setAttribute​(java.lang.String key,
                                 java.lang.Object value)
        add an attribute to this object.

        the value will be mapped to this object until

        • it will be removed with setAttribute(key,null)
        • or the garbage collector will remove it because it is no longer needed.
        .
        Parameters:
        key - the key
        value - may be null; this will remove the transient object mapping
      • setTransientObject

        @Deprecated
        public void setTransientObject​(java.lang.String key,
                                       java.lang.Object value)
        Deprecated.
        since ages - please use setAttribute(String,Object) instead.
        add an attribute to this Session.

      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
        get a session attribute.

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

        Parameters:
        key -
        Returns:
        the mapped object
      • getTransientObject

        @Deprecated
        public java.lang.Object getTransientObject​(java.lang.String key)
        Deprecated.
        since ages - please use #getAttribute(String) instead.
        get a session attribute.
      • getAttributeMap

        public java.util.Map getAttributeMap()
        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.

      • getTransientObjectMap

        @Deprecated
        public java.util.Map getTransientObjectMap()
        Deprecated.
        since ages - please use getAttributeMap instead.
        Returns the Complete Map of mapped attributes.

        Returns:
        the map
      • getFirstItemByAttribute

        public 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.
        Parameters:
        itemClass - The class of the Item
        attr - The Attribute
        attrVal - The Value of the Attribute to compare
        Returns:
        An Item or null
        Since:
        2.20
      • getFirstItemByAttribute

        @Deprecated
        public Item getFirstItemByAttribute​(java.lang.String attr,
                                            java.lang.Object attrVal,
                                            java.lang.Class itemClass)
        Deprecated.
        since ages - please use getFirstItemByAttribute(Class,String,Object)
        Returns the first found Item of a given class which matches a given Attributevalue.
        Since:
        2.20
      • getRemoteManagerClass

        public java.lang.Class getRemoteManagerClass()
      • getSingletonManagerInstance

        @Deprecated
        public static <T> T getSingletonManagerInstance​(java.lang.Class<T> clazz,
                                                        java.lang.String extName)
        Deprecated.
        since ages
      • wrap

        public java.lang.Object wrap​(java.lang.Object object)
      • writeReplace

        public abstract java.lang.Object writeReplace()
                                               throws java.io.ObjectStreamException
        Throws:
        java.io.ObjectStreamException