Class ScopedContextProperties

java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
com.logicaldoc.util.config.OrderedProperties
com.logicaldoc.util.config.ContextProperties
com.logicaldoc.enterprise.cluster.ScopedContextProperties
All Implemented Interfaces:
PayloadHandler, Serializable, Cloneable, EventListener, Map<Object,Object>, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>

public class ScopedContextProperties extends com.logicaldoc.util.config.ContextProperties implements org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, PayloadHandler
Extension of the standard ContextProperties able to give a scope(local or shared) to the config parameters. Initialize itself with the database where the shared properties are stored. Shared parameters are expected to be stored as Generics where type='conf', subtype=property name and string1=property value.
Since:
6.5
Author:
Marco Meschieri - LogicalDOC
See Also:
  • Constructor Details

  • Method Details

    • readGlobalProperties

      public Map<String,String> readGlobalProperties() throws com.logicaldoc.core.PersistenceException
      Reads the global settings from the database
      Returns:
      the map of settings
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • write

      public void write() throws IOException
      Writes like the parent class but also updates the DB with the global variables values.
      Overrides:
      write in class com.logicaldoc.util.config.ContextProperties
      Throws:
      IOException - Error in the I/O
    • handle

      public Object handle(Payload payload) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: PayloadHandler
      Invoked when a new message arrives from the cluster.
      Specified by:
      handle in interface PayloadHandler
      Parameters:
      payload - Payload to be processed
      Returns:
      The response to the received message
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the data layer
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>