com.franz.agraph.pool
Class AGConnFactory
java.lang.Object
com.franz.util.Closer
com.franz.agraph.pool.AGConnFactory
- All Implemented Interfaces:
- Closeable, org.apache.commons.pool.PoolableObjectFactory
public class AGConnFactory
- extends Closer
- implements org.apache.commons.pool.PoolableObjectFactory
Adapts the AGRepositoryConnection
API
to the commons-pool factory interface,
leaving creation of the connection (and configuration)
to a subclass, defined by users of this library.
- Since:
- v4.3.3
Methods inherited from class com.franz.util.Closer |
close, close, Close, close, Close, close, Close, close, Close, close, Close, close, Close, close, Close, close, Close, closeAll, closeLater, closeReflection, remove, toString |
AGConnFactory
public AGConnFactory(AGConnConfig props)
AGConnFactory
public AGConnFactory(AGConnConfig props,
AGPoolConfig poolProps)
makeObject
public Object makeObject()
throws Exception
- Specified by:
makeObject
in interface org.apache.commons.pool.PoolableObjectFactory
- Throws:
Exception
activateObject
public void activateObject(Object obj)
throws Exception
- Calls
AGRepositoryConnection.rollback()
and
resets AGRepositoryConnection.setAutoCommit(boolean)
if it has changed.
- Specified by:
activateObject
in interface org.apache.commons.pool.PoolableObjectFactory
- Throws:
Exception
destroyObject
public void destroyObject(Object obj)
throws Exception
- Specified by:
destroyObject
in interface org.apache.commons.pool.PoolableObjectFactory
- Throws:
Exception
passivateObject
public void passivateObject(Object obj)
throws Exception
- Specified by:
passivateObject
in interface org.apache.commons.pool.PoolableObjectFactory
- Throws:
Exception
validateObject
public boolean validateObject(Object obj)
- Calls
AGRepositoryConnection.size(org.openrdf.model.Resource...)
.
- Specified by:
validateObject
in interface org.apache.commons.pool.PoolableObjectFactory
handleCloseException
public <Obj> Obj handleCloseException(Obj o,
Throwable e)
- Description copied from class:
Closer
- Subclass may override, default behavior is to log.warn and return the object.
- Overrides:
handleCloseException
in class Closer