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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInvoked when a new message arrives from the cluster.void
onApplicationEvent
(org.springframework.context.event.ApplicationContextEvent event) Reads the global settings from the databasevoid
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, getFloat, getFloat, getInt, getInt, getLong, getLong, getMaxBackups, getProperties, getProperty, getProperty, getString, getString, getTenantProperties, getTenantProperty, removeTenantProperties, replicateTenantSettings, setMaxBackups
Methods inherited from class com.logicaldoc.util.config.OrderedProperties
getKeys, keys, store
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, 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 Details
-
ScopedContextProperties
- Throws:
IOException
-
-
Method Details
-
readGlobalProperties
Reads the global settings from the database- Returns:
- the map of settings
- Throws:
com.logicaldoc.core.PersistenceException
- Error in the database
-
write
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
- Error in the I/O
-
handle
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:
com.logicaldoc.core.PersistenceException
- Error in the data layer
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) - Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-