Class MetaInformationManager

  • All Implemented Interfaces:
    ItemLifecycleListener, java.io.Serializable

    public class MetaInformationManager
    extends Manager
    The manager for global informations stored in the hybris Platform ( meta - informations ).

    If a hybris Platform user or application wants to store information which does not actually belong to exactly one item or is meant to be global this is the place to store it.

    All informations are stored in global properties, which have qualifier and a value.

        MetaInformationManager mm = jaloSession.getMetaInformationManager();
        // example: store session count
        Long count = (Long)mm.getProperty( "sessionCount");
        mm.setProperty( "sessionCount" , new Long( count.longValue() + 1 );
     
    See Also:
    Serialized Form
    • Constructor Detail

      • MetaInformationManager

        public MetaInformationManager()
    • Method Detail

      • notifyItemRemoval

        protected void notifyItemRemoval​(SessionContext ctx,
                                         Item item)
        Superclass method overridden to avoid call to EJB layer
        Overrides:
        notifyItemRemoval in class Manager
        Parameters:
        ctx - the currency session context
        item - the item which is going to be removed
        Since:
        2.10
      • getPropertyNames

        public java.util.Set getPropertyNames()
        All global property names.
      • setProperty

        public java.lang.Object setProperty​(java.lang.String name,
                                            java.lang.Object value)
        Sets a global property.
        Parameters:
        name -
        value -
        Returns:
        the previously set property value, or null if it has not been set before.
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
        The value of a global property.
        Parameters:
        name -
        Returns:
        null if no such property was set before
      • removeProperty

        public java.lang.Object removeProperty​(java.lang.String name)
        Removes a global property.
        Parameters:
        name -
        Returns:
        the old value, or null if it has not been set before
      • setResourceBundle

        public void setResourceBundle​(java.lang.String basename,
                                      HybrisResourceBundle bundle)
        Sets a HybrisResourceBundle instance as a global property.
        Parameters:
        basename - a String that is part of the key which the bundle will be stored under (can be name of your application e.g."MyWebAppplication").
        bundle - the HybrisResourceBundle object to be set.
      • getResourceBundle

        public HybrisResourceBundle getResourceBundle​(java.lang.String basename,
                                                      java.util.Locale locale)
        Returns HybrisResourceBundle instance according to the given Locale. If no bundle is found for the specified locale, the method looks up bundles for the next lesser specialized locales ( if Locale("de","CH") not found, lookup for Locale("de") ).
        Parameters:
        basename - key the bundles are stored under.
        locale - a java.util.Locale object specifing the bundle.
        Returns:
        a HybrisResourceBundle or null if no corresponding bundle was found.
      • writeReplace

        public java.lang.Object writeReplace()
                                      throws java.io.ObjectStreamException
        Specified by:
        writeReplace in class Manager
        Throws:
        java.io.ObjectStreamException