org.apache.ojb.broker.util.configuration.impl
Class OjbConfiguration

java.lang.Object
  extended by org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
      extended by org.apache.ojb.broker.util.configuration.impl.OjbConfiguration
All Implemented Interfaces:
PBPoolConfiguration, PersistenceBrokerConfiguration, ProxyConfiguration, MetadataConfiguration, Configuration, OdmgConfiguration

public class OjbConfiguration
extends ConfigurationAbstractImpl
implements OdmgConfiguration, PersistenceBrokerConfiguration, ProxyConfiguration, PBPoolConfiguration, MetadataConfiguration

This class contains the runtime configuration of the OJB system. This Configuration is read in only once at application startup. Changes to the OJB.properties file during execution are not reflected back into the application!

Version:
$Id: OjbConfiguration.java,v 1.1 2007-08-24 22:17:42 ewestfal Exp $
Author:
Thomas Mahler

Field Summary
static String OJB_METADATA_FILE
          Default filename of the OJB repository metadata file
static String OJB_PROPERTIES_FILE
          Default filename of the OJB properties file
 
Fields inherited from class org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
filename, properties
 
Constructor Summary
OjbConfiguration()
           
 
Method Summary
 Class getCollectionProxyClass()
          Returns the proxy class used for that implement the Collection interface.
 Class getIndirectionHandlerClass()
          Returns the indirection handler implementation class.
 Class getListProxyClass()
          Returns the proxy class used for that implement the List interface.
 int getMaxActive()
           
 int getMaxIdle()
           
 long getMaxWaitMillis()
           
 long getMinEvictableIdleTimeMillis()
           
 Class getObjectCacheClass()
           
 Class getOqlCollectionClass()
          This class is used to hold results of OQL queries.
 Class getPersistenceBrokerClass()
           
 Class getPersistentFieldClass()
           
 Class getProxyFactoryClass()
          Returns the class that will be used as the proxy factory.
 String getRepositoryFilename()
           
 Class getSetProxyClass()
          Returns the proxy class used for that implement the Set interface.
 int getSqlInLimit()
          Returns the SQLInLimit.
 long getTimeBetweenEvictionRunsMilli()
           
 byte getWhenExhaustedAction()
           
protected  void load()
          Loads the configuration from file "OBJ.properties".
 boolean lockAssociationAsWrites()
          If true acquiring a write-lock on a given object x implies write locks on all objects associated to x.
 void setPersistentFieldClass(Class persistentFieldClass)
          Sets the persistentFieldClass.
 void setUseImplicitLocking(boolean implicitLocking)
           
 boolean useImplicitLocking()
          defines if implicit lock acquisition is to be used.
 boolean useSerializedRepository()
          If true OJB use a serialized version of the repository configuration file for repetition read.
 
Methods inherited from class org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
getBoolean, getByte, getClass, getClass, getClass, getInteger, getLong, getString, getStrings, getStrings, setFilename, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OJB_PROPERTIES_FILE

public static final String OJB_PROPERTIES_FILE
Default filename of the OJB properties file

See Also:
Constant Field Values

OJB_METADATA_FILE

public static final String OJB_METADATA_FILE
Default filename of the OJB repository metadata file

See Also:
Constant Field Values
Constructor Detail

OjbConfiguration

public OjbConfiguration()
Method Detail

useSerializedRepository

public boolean useSerializedRepository()
Description copied from interface: MetadataConfiguration
If true OJB use a serialized version of the repository configuration file for repetition read.

Specified by:
useSerializedRepository in interface MetadataConfiguration

lockAssociationAsWrites

public boolean lockAssociationAsWrites()
Description copied from interface: OdmgConfiguration
If true acquiring a write-lock on a given object x implies write locks on all objects associated to x. If false implicit read-locks are acquired.

Specified by:
lockAssociationAsWrites in interface OdmgConfiguration

getRepositoryFilename

public String getRepositoryFilename()
Specified by:
getRepositoryFilename in interface PersistenceBrokerConfiguration

getMaxActive

public int getMaxActive()
Specified by:
getMaxActive in interface PBPoolConfiguration

getMaxIdle

public int getMaxIdle()
Specified by:
getMaxIdle in interface PBPoolConfiguration

getMaxWaitMillis

public long getMaxWaitMillis()
Specified by:
getMaxWaitMillis in interface PBPoolConfiguration

getTimeBetweenEvictionRunsMilli

public long getTimeBetweenEvictionRunsMilli()
Specified by:
getTimeBetweenEvictionRunsMilli in interface PBPoolConfiguration

getMinEvictableIdleTimeMillis

public long getMinEvictableIdleTimeMillis()
Specified by:
getMinEvictableIdleTimeMillis in interface PBPoolConfiguration

getWhenExhaustedAction

public byte getWhenExhaustedAction()
Specified by:
getWhenExhaustedAction in interface PBPoolConfiguration

getObjectCacheClass

public Class getObjectCacheClass()
Specified by:
getObjectCacheClass in interface PersistenceBrokerConfiguration

getOqlCollectionClass

public Class getOqlCollectionClass()
Description copied from interface: OdmgConfiguration
This class is used to hold results of OQL queries. By default a DListImpl is used.

Specified by:
getOqlCollectionClass in interface OdmgConfiguration

getPersistentFieldClass

public Class getPersistentFieldClass()
Specified by:
getPersistentFieldClass in interface PersistenceBrokerConfiguration

getPersistenceBrokerClass

public Class getPersistenceBrokerClass()
Specified by:
getPersistenceBrokerClass in interface PersistenceBrokerConfiguration

getIndirectionHandlerClass

public Class getIndirectionHandlerClass()
Returns the indirection handler implementation class.

Specified by:
getIndirectionHandlerClass in interface ProxyConfiguration
Returns:
The indirection handler class
See Also:
IndirectionHandler

getListProxyClass

public Class getListProxyClass()
Returns the proxy class used for that implement the List interface.

Specified by:
getListProxyClass in interface ProxyConfiguration
Returns:
The proxy class
See Also:
ProxyFactory.setListProxyClass(Class)

getSetProxyClass

public Class getSetProxyClass()
Returns the proxy class used for that implement the Set interface.

Specified by:
getSetProxyClass in interface ProxyConfiguration
Returns:
The proxy class
See Also:
ProxyFactory.setSetProxyClass(Class)

getCollectionProxyClass

public Class getCollectionProxyClass()
Returns the proxy class used for that implement the Collection interface.

Specified by:
getCollectionProxyClass in interface ProxyConfiguration
Returns:
The proxy class
See Also:
ProxyFactory.setCollectionProxyClass(Class)

getProxyFactoryClass

public Class getProxyFactoryClass()
Returns the class that will be used as the proxy factory.

Specified by:
getProxyFactoryClass in interface ProxyConfiguration
Returns:
The proxy factory class

load

protected void load()
Loads the configuration from file "OBJ.properties". If the system property "OJB.properties" is set, then the configuration in that file is loaded. Otherwise, the file "OJB.properties" is tried. If that is also unsuccessful, then the configuration is filled with default values.

Overrides:
load in class ConfigurationAbstractImpl
See Also:
ConfigurationAbstractImpl.setFilename(java.lang.String)

getSqlInLimit

public int getSqlInLimit()
Returns the SQLInLimit.

Specified by:
getSqlInLimit in interface PersistenceBrokerConfiguration
Returns:
int

setPersistentFieldClass

public void setPersistentFieldClass(Class persistentFieldClass)
Sets the persistentFieldClass.

Parameters:
persistentFieldClass - The persistentFieldClass to set

useImplicitLocking

public boolean useImplicitLocking()
Description copied from interface: OdmgConfiguration
defines if implicit lock acquisition is to be used. If set to true OJB implicitely locks objects to ODMG transactions after performing OQL queries. If implicit locking is used locking objects is recursive, that is associated objects are also locked. If ImplicitLocking is set to false, no locks are obtained in OQL queries and there is also no recursive locking.

Specified by:
useImplicitLocking in interface OdmgConfiguration
See Also:
OdmgConfiguration.useImplicitLocking()

setUseImplicitLocking

public void setUseImplicitLocking(boolean implicitLocking)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.