SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.conf
Class DefaultConfiguration

java.lang.Object
  |
  +--com.solarmetric.kodo.conf.DefaultConfiguration
All Implemented Interfaces:
BeanInfo, 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.

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.

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.

See Also:
Serialized Form

Field Summary
(package private) static Localizer _loc
           
(package private)  org.apache.commons.logging.Log _log
           
 
Fields inherited from interface com.solarmetric.kodo.conf.Configuration
LOG_CACHE, LOG_CONF, LOG_ENHANCE, LOG_METADATA, LOG_PERFORMANCE, LOG_PORTABILITY, LOG_QUERY, LOG_RUNTIME
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
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 any setter methods will throw a JDOUserException.
 void fromProperties(Properties properties)
          Set this Configuration via the given Properties.
protected  org.apache.commons.logging.Log getLog()
           
abstract  Value[] getValues()
           
 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.
 void setProperties(String resourceName)
          Sets the name of the properties resource that will be resolved against the current Thread's context class loader as the resource that contains the properties to use to initialize this Configuration.
 void setPropertiesFile(File file)
          Set the File that will be used to load the properties.
 void setPropertiesInputStream(InputStream in)
          Initialize this Configuration from the specified InputStream.
 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
getCacheReferenceSize, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactory2Properties, getConnectionFactoryName, getConnectionPassword, getConnectionProperties, getConnectionPropertiesProps, getConnectionURL, getConnectionUserName, getDataCache, getDataCacheClass, getDataCacheProperties, getDefaultDataCacheTimeout, getDefaultFetchBatchSize, getDefaultFetchThreshold, getEnableQueryExtensions, getFetchGroupNames, getFetchGroups, getFlushBeforeQueries, getFlushBeforeQueriesMode, getIgnoreCache, getLicenseKey, getMaxPool, getMinPool, getMsWait, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManagerClass, getPersistenceManagerFactoryClass, getPersistenceManagerProperties, getPersistentTypeNames, getPersistentTypes, getProxyManager, getProxyManagerClass, getProxyManagerProperties, getQueryCache, getQueryCacheClass, getQueryCacheProperties, getQueryFilterListenerInstances, getQueryFilterListeners, getRemoteCommitProviderClass, getRemoteCommitProviderProperties, getRestoreValues, getResultListClass, getResultListProperties, getRetainValues, getTransactionCacheClass, getTransactionCacheProperties, getTransactionMode, getTransactionModeIsXA, getUseSoftTransactionCache, setCacheReferenceSize, setCacheReferenceSize, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactory2Properties, setConnectionFactoryName, setConnectionPassword, setConnectionProperties, setConnectionURL, setConnectionUserName, setDataCache, setDataCacheClass, setDataCacheProperties, setDefaultDataCacheTimeout, setDefaultDataCacheTimeout, setDefaultFetchBatchSize, setDefaultFetchBatchSize, setDefaultFetchThreshold, setDefaultFetchThreshold, setEnableQueryExtensions, setEnableQueryExtensions, setFetchGroups, setFlushBeforeQueries, setIgnoreCache, setIgnoreCache, setLicenseKey, setMaxPool, setMaxPool, setMinPool, setMinPool, setMsWait, setMsWait, setMultithreaded, setMultithreaded, setNontransactionalRead, setNontransactionalRead, setNontransactionalWrite, setNontransactionalWrite, setOptimistic, setOptimistic, setPersistenceManagerClass, setPersistenceManagerFactoryClass, setPersistenceManagerProperties, setPersistentTypes, setProxyManager, setProxyManagerClass, setProxyManagerProperties, setQueryCache, setQueryCacheClass, setQueryCacheProperties, setQueryFilterListenerInstances, setQueryFilterListeners, setRemoteCommitProviderClass, setRemoteCommitProviderProperties, setRestoreValues, setRestoreValues, setResultListClass, setResultListProperties, setRetainValues, setRetainValues, setTransactionCacheClass, setTransactionCacheProperties, setTransactionMode, setUseSoftTransactionCache, setUseSoftTransactionCache
 
Methods inherited from interface java.beans.BeanInfo
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getPropertyDescriptors
 

Field Detail

_loc

static Localizer _loc

_log

transient org.apache.commons.logging.Log _log
Constructor Detail

DefaultConfiguration

public DefaultConfiguration()
Method Detail

loadDefaults

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

getLog

protected org.apache.commons.logging.Log getLog()

setProperties

public void setProperties(String resourceName)
                   throws IOException
Sets the name of the properties resource that will be resolved against the current Thread's context class loader as the resource that contains the properties to use to initialize this Configuration.
Parameters:
resourceName - the name of the resource to use

setPropertiesInputStream

public void setPropertiesInputStream(InputStream in)
                              throws IOException
Initialize this Configuration from the specified InputStream.
Parameters:
in - the InputStream that contains the properties information
Since:
2.5.0

setPropertiesFile

public void setPropertiesFile(File file)
                       throws IOException
Set the File that will be used to load the properties.
Parameters:
file - the File that contains the properties resource.
Since:
2.5.0

freeze

public void freeze()
Description copied from interface: Configuration
Freeze this Configuration; if frozen, calls to any setter methods 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 final 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

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

getValues

public abstract Value[] getValues()

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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