public class AGConnFactory extends Closer implements org.apache.commons.pool.PoolableObjectFactory
AGRepositoryConnection
API
to the commons-pool factory interface,
leaving creation of the connection (and configuration)
to a subclass, defined by users of this library.Constructor and Description |
---|
AGConnFactory(AGConnConfig props) |
AGConnFactory(AGConnConfig props,
AGPoolConfig poolProps) |
Modifier and Type | Method and Description |
---|---|
void |
activateObject(Object obj)
Calls
AGRepositoryConnection.rollback() and
resets AGRepositoryConnection.setAutoCommit(boolean)
if it has changed. |
void |
destroyObject(Object obj) |
<Obj> Obj |
handleCloseException(Obj o,
Throwable e)
Subclass may override, default behavior is to log.warn and return the object.
|
Object |
makeObject() |
void |
passivateObject(Object obj) |
boolean |
validateObject(Object obj)
|
public AGConnFactory(AGConnConfig props)
public AGConnFactory(AGConnConfig props, AGPoolConfig poolProps)
public Object makeObject() throws Exception
makeObject
in interface org.apache.commons.pool.PoolableObjectFactory
Exception
public void activateObject(Object obj) throws Exception
AGRepositoryConnection.rollback()
and
resets AGRepositoryConnection.setAutoCommit(boolean)
if it has changed.activateObject
in interface org.apache.commons.pool.PoolableObjectFactory
Exception
public void destroyObject(Object obj) throws Exception
destroyObject
in interface org.apache.commons.pool.PoolableObjectFactory
Exception
public void passivateObject(Object obj) throws Exception
passivateObject
in interface org.apache.commons.pool.PoolableObjectFactory
Exception
public boolean validateObject(Object obj)
validateObject
in interface org.apache.commons.pool.PoolableObjectFactory
public <Obj> Obj handleCloseException(Obj o, Throwable e)
Closer
handleCloseException
in class Closer