Class MetaInformationManager

java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.meta.MetaInformationManager
All Implemented Interfaces:
ItemLifecycleListener, 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:
  • Field Details

  • Constructor Details

    • MetaInformationManager

      public MetaInformationManager()
  • Method Details

    • getInstance

      public static MetaInformationManager getInstance()
      Returns:
      instance of this manager
    • getRemoteManagerClass

      public Class getRemoteManagerClass()
      Overrides:
      getRemoteManagerClass in class Manager
    • checkBeforeItemRemoval

      protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
      Superclass method overridden to avoid call to EJB layer
      Overrides:
      checkBeforeItemRemoval in class Manager
      Parameters:
      ctx - the current session context
      item - the item which should be removed
      Throws:
      ConsistencyCheckException - thrown to abort removal due to consistency errors
      Since:
      2.10
    • 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 Set getPropertyNames()
      All global property names.
    • setProperty

      public Object setProperty(String name, 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 Object getProperty(String name)
      The value of a global property.
      Parameters:
      name -
      Returns:
      null if no such property was set before
    • removeProperty

      public Object removeProperty(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(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(String basename, 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 Object writeReplace() throws ObjectStreamException
      Specified by:
      writeReplace in class Manager
      Throws:
      ObjectStreamException