SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

com.solarmetric.kodo.conf
Class DefaultConfiguration

java.lang.Object
  |
  +--com.solarmetric.kodo.conf.DefaultConfiguration
All Implemented Interfaces:
Cloneable, Configuration, Serializable
Direct Known Subclasses:
SimpleConfiguration

public abstract class DefaultConfiguration
extends Object
implements Configuration, Cloneable

This Configuration type initializes from the settings in either the kodo.properties properties file. Any recognized property can also be overridden by setting the System property of the same name to the desired value.

If the kodo.properties file is not present the system will search for the system.prefs XML file and load from it, though the use of this file should be considered deprecated.

Either file must be located at the top level of the CLASSPATH for the context loader of the creating thread. Alternatively, the location of the properties file can be specified by setting the com.solarmetric.kodo.properties system property; the location of the XML resource can similarly be specified by setting the solarmetric.system.prefs system property.

Note that changing any properties of this Configuration will not result in changes to the files, and therefore will not be visible to other instances or after the JVM has restarted.

See the Configuration interface for lists of recognized properties, XML preferences.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
DefaultConfiguration()
           
 
Method Summary
protected  void checkFrozen()
          Checks if the configuration has been frozen and if so throws a JDOUserException, otherwise returns silently.
 Object clone()
          Returns a clone of this Configuration.
 Configuration configurationClone()
          Return a new Configuration that is an exact copy of this one.
 boolean equals(Object other)
          Performs the equality check based on set property values from toProperties().
 void freeze()
          Freeze this Configuration; if frozen, calls to checkFrozen() will throw a JDOUserException.
 void fromProperties(Properties properties)
          Set this Configuration via the given Properties.
 int hashCode()
          Computes hash code based on set property values from toProperties().
 boolean isFrozen()
          Return true if this Configuration has been frozen.
protected  void loadDefaults()
          Invoke this method to load default values from properties/prefs.
protected  void setFromPreferences()
          Override this method to support setting subclass state from preferences.
protected  void setFromProperties(TypedProperties props)
          Override this method to support setting subclass state from properties.
protected  void setToProperties(TypedProperties props)
          Override this method to support serializing subclass state to properties.
 Properties toProperties()
          A Properties representation of this Configuration.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.solarmetric.kodo.conf.Configuration
getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionPassword, getConnectionURL, getConnectionUserName, getDataCache, getDataCacheClass, getDataCacheProperties, getDefaultFetchBatchSize, getDefaultFetchThreshold, getEnableQueryExtensions, getIgnoreCache, getLicenseKey, getLogger, getLogWriter, getMaxPool, getMinPool, getMsWait, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManagerClass, getPersistenceManagerFactoryClass, getPersistenceManagerProperties, getProxyManager, getProxyManagerClass, getProxyManagerProperties, getQueryFilterListeners, getRestoreValues, getRetainValues, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactoryName, setConnectionPassword, setConnectionURL, setConnectionUserName, setDataCache, setDataCacheClass, setDataCacheProperties, setDefaultFetchBatchSize, setDefaultFetchThreshold, setEnableQueryExtensions, setIgnoreCache, setLicenseKey, setLogger, setLogWriter, setMaxPool, setMinPool, setMsWait, setMultithreaded, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setPersistenceManagerClass, setPersistenceManagerFactoryClass, setPersistenceManagerProperties, setProxyManager, setProxyManagerClass, setProxyManagerProperties, setQueryFilterListeners, setRestoreValues, setRetainValues
 

Constructor Detail

DefaultConfiguration

public DefaultConfiguration()
Method Detail

loadDefaults

protected void loadDefaults()
Invoke this method to load default values from properties/prefs. This is not performed on construction so that subclasses can initialize state before loading defaults.

freeze

public void freeze()
Description copied from interface: Configuration
Freeze this Configuration; if frozen, calls to #checkFrozen will throw a JDOUserException.
Specified by:
freeze in interface Configuration

isFrozen

public boolean isFrozen()
Description copied from interface: Configuration
Return true if this Configuration has been frozen.
Specified by:
isFrozen in interface Configuration

clone

public Object clone()
Description copied from interface: Configuration
Returns a clone of this Configuration. The clone will not have its configuration frozen, regardless of the original setting of the original.
Specified by:
clone in interface Configuration
Overrides:
clone in class Object

configurationClone

public Configuration configurationClone()
Description copied from interface: Configuration
Return a new Configuration that is an exact copy of this one.
Specified by:
configurationClone in interface Configuration

toProperties

public Properties toProperties()
Description copied from interface: Configuration
A Properties representation of this Configuration. Note that changes made to this Properties object will not be automatically reflected in this Configuration object.
Specified by:
toProperties in interface Configuration

fromProperties

public void fromProperties(Properties properties)
Description copied from interface: Configuration
Set this Configuration via the given Properties. Any keys missing from the given properties will not be set. Note that changes made to this Properties object will not be automatically reflected in this Configuration object.
Specified by:
fromProperties in interface Configuration

setFromPreferences

protected void setFromPreferences()
Override this method to support setting subclass state from preferences.

setToProperties

protected void setToProperties(TypedProperties props)
Override this method to support serializing subclass state to properties.

setFromProperties

protected void setFromProperties(TypedProperties props)
Override this method to support setting subclass state from properties.

checkFrozen

protected void checkFrozen()
Checks if the configuration has been frozen and if so throws a JDOUserException, otherwise returns silently. Implementations should call this method before setting any state.

equals

public boolean equals(Object other)
Performs the equality check based on set property values from toProperties().
Overrides:
equals in class Object

hashCode

public int hashCode()
Computes hash code based on set property values from toProperties().
Overrides:
hashCode in class Object

SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.