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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ScopedContextProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
handle(Payload payload)
Invoked when a new message arrives from the cluster.void
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
Map<String,String>
readGlobalProperties()
void
write()
Writes like the parent class but also updates the DB with the global variables values.-
Methods inherited from class com.logicaldoc.util.config.ContextProperties
getBackups, getBoolean, getBoolean, getDouble, getDouble, getInt, getInt, getLong, getLong, getMaxBackups, getProperties, getPropertyWithSubstitutions, getPropertyWithSubstitutions, getString, getString, getTenantProperties, getTenantProperty, removeTenantProperties, replicateTenantSettings, setMaxBackups
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Constructor Detail
-
ScopedContextProperties
public ScopedContextProperties() throws IOException
- Throws:
IOException
-
-
Method Detail
-
write
public void write() throws IOException
Writes like the parent class but also updates the DB with the global variables values.- Overrides:
write
in classcom.logicaldoc.util.config.ContextProperties
- Throws:
IOException
-
handle
public Object handle(Payload payload) throws Exception
Description copied from interface:PayloadHandler
Invoked when a new message arrives from the cluster.- Specified by:
handle
in interfacePayloadHandler
- Parameters:
payload
- Payload to be processed- Returns:
- The response to the received message
- Throws:
Exception
- a generic error
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-
-