class PropertyConglomerate
extends java.lang.Object
The PropertyConglomerate contains one row with 2 columns per property. Column 0 is the UTF key, and column 1 is the data.
The property conglomerate manages the storage of database properties and thier defaults. Each property is stored as a row in the PropertyConglomerate
In general a propery default defines it value if the property itself is not defined.
Because the properties conglomerate is stored in a conglomerate the information it contains is not available before the raw store runs recovery. To make a small number of properties (listed in servicePropertyList) available during early boot, this copies them to services.properties.
Modifier and Type | Field and Description |
---|---|
private CacheLock |
cachedLock |
private java.util.Dictionary<java.lang.String,java.lang.Object> |
cachedSet |
private LockFactory |
lf |
private PropertyFactory |
pf |
protected long |
propertiesConglomId |
protected java.util.Properties |
serviceProperties |
Constructor and Description |
---|
PropertyConglomerate(TransactionController tc,
boolean create,
java.util.Properties serviceProperties,
PropertyFactory pf) |
Modifier and Type | Method and Description |
---|---|
private boolean |
bootPasswordChange(TransactionController tc,
java.lang.String key,
java.io.Serializable value) |
private <K,V> java.util.Dictionary<? super K,? super V> |
copyValues(java.util.Dictionary<? super K,? super V> to,
java.util.Dictionary<K,V> from,
boolean stringsOnly) |
private static java.lang.Object |
findServiceModule(java.lang.Object serviceModule,
java.lang.String factoryInterface)
Privileged startup.
|
private java.util.Dictionary<java.lang.String,java.lang.Object> |
getCachedDbProperties(TransactionController tc) |
private java.io.Serializable |
getCachedProperty(TransactionController tc,
java.lang.String key) |
private java.io.Serializable |
getCachedPropertyDefault(TransactionController tc,
java.lang.String key,
java.util.Dictionary dbProps) |
(package private) java.util.Properties |
getProperties(TransactionController tc)
Fetch the set of properties as a Properties object.
|
void |
getProperties(TransactionController tc,
java.util.Dictionary<java.lang.Object,java.lang.Object> d,
boolean stringsOnly,
boolean defaultsOnly) |
(package private) java.io.Serializable |
getProperty(TransactionController tc,
java.lang.String key)
Gets the de-serialized object associated with a property key.
|
(package private) java.io.Serializable |
getPropertyDefault(TransactionController tc,
java.lang.String key)
Get the default for a property.
|
private boolean |
iHoldTheUpdateLock(TransactionController tc)
Return true if the caller holds the exclusive update lock on the
property conglomerate.
|
(package private) void |
lockProperties(TransactionController tc)
Lock the database properties for an update.
|
private DataValueDescriptor[] |
makeNewTemplate()
Create a new empty PropertyConglomerate row, to fetch values into.
|
private DataValueDescriptor[] |
makeNewTemplate(java.lang.String key,
java.io.Serializable value)
Create a new PropertyConglomerate row, with values in it.
|
private java.io.Serializable |
map(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary set)
Call the property set callbacks to map a proposed property value
to a value to save.
|
private ScanController |
openScan(TransactionController tc,
java.lang.String key,
int open_mode)
Open a scan on the properties conglomerate looking for "key".
|
(package private) boolean |
propertyDefaultIsVisible(TransactionController tc,
java.lang.String key) |
private java.util.Dictionary<java.lang.String,java.lang.Object> |
readDbProperties(TransactionController tc)
Read the database properties and add in the service set.
|
private java.io.Serializable |
readProperty(TransactionController tc,
java.lang.String key) |
(package private) void |
resetCache() |
(package private) void |
saveProperty(TransactionController tc,
java.lang.String key,
java.io.Serializable value) |
(package private) void |
savePropertyDefault(TransactionController tc,
java.lang.String key,
java.io.Serializable value) |
private boolean |
saveServiceProperty(java.lang.String key,
java.io.Serializable value) |
(package private) void |
setProperty(TransactionController tc,
java.lang.String key,
java.io.Serializable value,
boolean dbOnlyProperty)
Sets the Serializable object associated with a property key.
|
(package private) void |
setPropertyDefault(TransactionController tc,
java.lang.String key,
java.io.Serializable value)
Set the default for a property.
|
private void |
validate(java.lang.String key,
java.io.Serializable value,
java.util.Dictionary set)
Call the property set callbacks to validate a property change
against the property set provided.
|
private java.io.Serializable |
validateApplyAndMap(TransactionController tc,
java.lang.String key,
java.io.Serializable value,
boolean dbOnlyProperty) |
protected long propertiesConglomId
protected java.util.Properties serviceProperties
private LockFactory lf
private java.util.Dictionary<java.lang.String,java.lang.Object> cachedSet
private CacheLock cachedLock
private PropertyFactory pf
PropertyConglomerate(TransactionController tc, boolean create, java.util.Properties serviceProperties, PropertyFactory pf) throws StandardException
StandardException
private DataValueDescriptor[] makeNewTemplate(java.lang.String key, java.io.Serializable value)
private DataValueDescriptor[] makeNewTemplate()
private ScanController openScan(TransactionController tc, java.lang.String key, int open_mode) throws StandardException
Open a scan on the properties conglomerate qualified to find the row with value key in column 0. Both column 0 and column 1 are included in the scan list.
tc
- The transaction to do the Conglomerate work under.key
- The "key" of the property that is being requested.open_mode
- Whether we are setting or getting the property.StandardException
- Standard exception policy.void setPropertyDefault(TransactionController tc, java.lang.String key, java.io.Serializable value) throws StandardException
StandardException
- Standard exception policy.boolean propertyDefaultIsVisible(TransactionController tc, java.lang.String key) throws StandardException
StandardException
void saveProperty(TransactionController tc, java.lang.String key, java.io.Serializable value) throws StandardException
StandardException
private boolean saveServiceProperty(java.lang.String key, java.io.Serializable value)
void savePropertyDefault(TransactionController tc, java.lang.String key, java.io.Serializable value) throws StandardException
StandardException
private java.io.Serializable validateApplyAndMap(TransactionController tc, java.lang.String key, java.io.Serializable value, boolean dbOnlyProperty) throws StandardException
StandardException
private java.io.Serializable map(java.lang.String key, java.io.Serializable value, java.util.Dictionary set) throws StandardException
The caller must run this in a block synchronized on this to serialize validations with changes to the set of property callbacks
StandardException
private void validate(java.lang.String key, java.io.Serializable value, java.util.Dictionary set) throws StandardException
The caller must run this in a block synchronized on this to serialize validations with changes to the set of property callbacks
StandardException
private boolean bootPasswordChange(TransactionController tc, java.lang.String key, java.io.Serializable value) throws StandardException
StandardException
void setProperty(TransactionController tc, java.lang.String key, java.io.Serializable value, boolean dbOnlyProperty) throws StandardException
This implementation turns the setProperty into an insert into the PropertyConglomerate conglomerate.
See the discussion of getProperty().
The value stored may be a Formatable object or a Serializable object whose class name starts with java.*. This stops arbitary objects being stored in the database by class name, which will cause problems in obfuscated/non-obfuscated systems.
tc
- The transaction to do the Conglomerate work under.key
- The key used to lookup this property.value
- The value to be associated with this key. If null,
delete the property from the properties list.StandardException
- Standard exception policy.private java.io.Serializable readProperty(TransactionController tc, java.lang.String key) throws StandardException
StandardException
private java.io.Serializable getCachedProperty(TransactionController tc, java.lang.String key) throws StandardException
StandardException
private java.io.Serializable getCachedPropertyDefault(TransactionController tc, java.lang.String key, java.util.Dictionary dbProps) throws StandardException
StandardException
java.io.Serializable getProperty(TransactionController tc, java.lang.String key) throws StandardException
The Store provides a transaction protected list of database properties. Higher levels of the system can store and retrieve these properties once Recovery has finished. Each property is a serializable object and is stored/retrieved using a String key.
In this implementation a lookup is done on the PropertyConglomerate conglomerate, using a scan with "key" as the qualifier.
tc
- The transaction to do the Conglomerate work under.key
- The "key" of the property that is being requested.StandardException
- Standard exception policy.java.io.Serializable getPropertyDefault(TransactionController tc, java.lang.String key) throws StandardException
StandardException
- Standard exception policy.private <K,V> java.util.Dictionary<? super K,? super V> copyValues(java.util.Dictionary<? super K,? super V> to, java.util.Dictionary<K,V> from, boolean stringsOnly)
java.util.Properties getProperties(TransactionController tc) throws StandardException
StandardException
public void getProperties(TransactionController tc, java.util.Dictionary<java.lang.Object,java.lang.Object> d, boolean stringsOnly, boolean defaultsOnly) throws StandardException
StandardException
void resetCache()
private java.util.Dictionary<java.lang.String,java.lang.Object> readDbProperties(TransactionController tc) throws StandardException
StandardException
private java.util.Dictionary<java.lang.String,java.lang.Object> getCachedDbProperties(TransactionController tc) throws StandardException
StandardException
void lockProperties(TransactionController tc) throws StandardException
StandardException
private boolean iHoldTheUpdateLock(TransactionController tc) throws StandardException
StandardException
private static java.lang.Object findServiceModule(java.lang.Object serviceModule, java.lang.String factoryInterface) throws StandardException
StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.