org.jasig.portal.rdbm.pool
Class PooledDataSourceFactoryFactory

java.lang.Object
  extended by org.jasig.portal.rdbm.pool.PooledDataSourceFactoryFactory

public final class PooledDataSourceFactoryFactory
extends java.lang.Object

Since:
uPortal 2.5
Version:
$Revision: 1.6.2.1 $ $Date: 2005/10/19 16:25:52 $
Author:
Eric Dalquist edalquist@unicon.net

Field Summary
(package private) static java.lang.Class DEFAULT_POOLED_DATASOURCE_FACTORY
          Our default IPooledDataSourceFactory implementation upon which we will fall back if our property is not set or we cannot instantiate the implementation specified by our property.
private static org.apache.commons.logging.Log LOG
          A Commons Logging log instance.
static java.lang.String POOLED_DATA_SOURCE_FACTORY_PROPERTY
          The name of the portal.properties property the value of which will be the name of the IPooledDataSourceFactory implementation that we will use.
private static IPooledDataSourceFactory pooledDataSourceFactoryImpl
          Our static singleton instance that we're managing.
 
Constructor Summary
private PooledDataSourceFactoryFactory()
          This private constructor prevents instantiation of this static factory class.
 
Method Summary
static IPooledDataSourceFactory getPooledDataSourceFactory()
          Get a reference to our static singleton instance of IPooledDataSourceFactory as specified in our portal.properties property, or our default implementation, or null.
(package private) static void reset()
          Clears this static factory's static singleton instance of IPooledDataSourceFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POOLED_DATA_SOURCE_FACTORY_PROPERTY

public static final java.lang.String POOLED_DATA_SOURCE_FACTORY_PROPERTY
The name of the portal.properties property the value of which will be the name of the IPooledDataSourceFactory implementation that we will use.

See Also:
Constant Field Values

LOG

private static final org.apache.commons.logging.Log LOG
A Commons Logging log instance.


DEFAULT_POOLED_DATASOURCE_FACTORY

static final java.lang.Class DEFAULT_POOLED_DATASOURCE_FACTORY
Our default IPooledDataSourceFactory implementation upon which we will fall back if our property is not set or we cannot instantiate the implementation specified by our property. Default scoped to be accessible to our testcase.


pooledDataSourceFactoryImpl

private static IPooledDataSourceFactory pooledDataSourceFactoryImpl
Our static singleton instance that we're managing.

Constructor Detail

PooledDataSourceFactoryFactory

private PooledDataSourceFactoryFactory()
This private constructor prevents instantiation of this static factory class.

Method Detail

getPooledDataSourceFactory

public static IPooledDataSourceFactory getPooledDataSourceFactory()
Get a reference to our static singleton instance of IPooledDataSourceFactory as specified in our portal.properties property, or our default implementation, or null. That is, this method returns our static singleton instance of IPooledDataSourceFactory. That instance will be an instance of the implementation named in our portal.properties property if we are able to instantiate that, or an instance of our default implementation if we were unable to instantiate the configured implementation, or null if we can instantiate neither. This method is synchronized to avoid using the much-feared Double Checked Locking idiom. By synchronizing we force the change we make when we first (lazily) initialize our pooledDataSourceFactoryImpl to be written back to main memory and thereby be available to other threads when they succeed in obtaining the lock and entering this method.

Returns:
the configured or default IPooledDataSourceFactory, or null if neither can be instantiated.

reset

static void reset()
Clears this static factory's static singleton instance of IPooledDataSourceFactory. This method exists to support the unit test for this class and should not be considered part of the API exported by this class.