org.openanzo.common.rdb.container
Class ContainerConnectionFactory

java.lang.Object
  extended by org.openanzo.common.rdb.container.ContainerConnectionFactory
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory

public class ContainerConnectionFactory
extends java.lang.Object
implements org.apache.commons.pool.PoolableObjectFactory

ContainerConnectionFactory is used to create RDBConnections for a pool

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
ContainerConnectionFactory(ContainerConnectionPool repositoryConnectionPool, org.apache.commons.pool.impl.GenericObjectPool parentPool, LiteralIndexer literalIndexer, int type, int maxActive, RDBConfiguration configuration)
          Create new ContainerConnectionPoolFactory
 
Method Summary
 void activateObject(java.lang.Object obj)
          Activate RDBConnection from pool
 void close()
          Close the factory
 void destroyObject(java.lang.Object obj)
          Destory RDBConnection
 java.lang.Object makeObject()
          Make new RDBConnection
 void passivateObject(java.lang.Object obj)
          Put RDBConnection back in pool
 boolean validateObject(java.lang.Object obj)
          Validate RDBConnection is still good
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerConnectionFactory

public ContainerConnectionFactory(ContainerConnectionPool repositoryConnectionPool,
                                  org.apache.commons.pool.impl.GenericObjectPool parentPool,
                                  LiteralIndexer literalIndexer,
                                  int type,
                                  int maxActive,
                                  RDBConfiguration configuration)
Create new ContainerConnectionPoolFactory

Parameters:
repositoryConnectionPool - Pool of jdbc connections
parentPool - Parent pool that is using this factory to create connections
literalIndexer - Literal indexer for the connections in this pool
type - rw or query connections
maxActive - connections allowed
configuration - data for connections
Method Detail

close

public void close()
           throws java.lang.Exception
Close the factory

Throws:
java.lang.Exception

activateObject

public void activateObject(java.lang.Object obj)
                    throws java.lang.Exception
Activate RDBConnection from pool

Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

destroyObject

public void destroyObject(java.lang.Object obj)
                   throws java.lang.Exception
Destory RDBConnection

Specified by:
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

makeObject

public java.lang.Object makeObject()
                            throws java.lang.Exception
Make new RDBConnection

Specified by:
makeObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

passivateObject

public void passivateObject(java.lang.Object obj)
                     throws java.lang.Exception
Put RDBConnection back in pool

Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

validateObject

public boolean validateObject(java.lang.Object obj)
Validate RDBConnection is still good

Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.