AGConnFactory (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.pool, class: AGConnFactory

Package com.franz.agraph.pool

# Class AGConnFactory

java.lang.Object
org.apache.commons.pool2.BaseObject
org.apache.commons.pool2.BasePooledObjectFactory<AGRepositoryConnection>
com.franz.agraph.pool.AGConnFactory

All Implemented Interfaces:
  `PooledObjectFactory<AGRepositoryConnection>`

public class AGConnFactory extends BasePooledObjectFactory<AGRepositoryConnection> implements PooledObjectFactory<AGRepositoryConnection>
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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AGConnFactory(AGConnConfig props)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `activateObject(PooledObject<AGRepositoryConnection> pooled)`
  `AGRepositoryConnection`
  `create()`
  `void`
  `destroyObject(PooledObject<AGRepositoryConnection> pooled)`
  `boolean`
  `validateObject(PooledObject<AGRepositoryConnection> pooled)`
  Calls `AGRepositoryConnection.size(org.eclipse.rdf4j.model.Resource...)`.
  `PooledObject<AGRepositoryConnection>`
  `wrap(AGRepositoryConnection conn)`

  ### Methods inherited from class org.apache.commons.pool2.BasePooledObjectFactory

  `makeObject, passivateObject`

  ### Methods inherited from class org.apache.commons.pool2.BaseObject

  `toString`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.apache.commons.pool2.PooledObjectFactory

  `destroyObject, makeObject, passivateObject`

- ## Constructor Details

  - ### AGConnFactory

    public AGConnFactory(AGConnConfig props)

- ## Method Details

  - ### create

    public AGRepositoryConnection create() throws Exception
    Specified by:
      `create` in class `BasePooledObjectFactory<AGRepositoryConnection>`
    Throws:
      `Exception`

  - ### wrap

    public PooledObject<AGRepositoryConnection> wrap(AGRepositoryConnection conn)
    Specified by:
      `wrap` in class `BasePooledObjectFactory<AGRepositoryConnection>`

  - ### activateObject

    public void activateObject(PooledObject<AGRepositoryConnection> pooled) throws org.eclipse.rdf4j.repository.RepositoryException
    Specified by:
      `activateObject` in interface `PooledObjectFactory<AGRepositoryConnection>`
    Overrides:
      `activateObject` in class `BasePooledObjectFactory<AGRepositoryConnection>`
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException`

  - ### validateObject

    public boolean validateObject(PooledObject<AGRepositoryConnection> pooled)
    Calls `AGRepositoryConnection.size(org.eclipse.rdf4j.model.Resource...)`.
    Specified by:
      `validateObject` in interface `PooledObjectFactory<AGRepositoryConnection>`
    Overrides:
      `validateObject` in class `BasePooledObjectFactory<AGRepositoryConnection>`

  - ### destroyObject

    public void destroyObject(PooledObject<AGRepositoryConnection> pooled)
    Specified by:
      `destroyObject` in interface `PooledObjectFactory<AGRepositoryConnection>`
    Overrides:
      `destroyObject` in class `BasePooledObjectFactory<AGRepositoryConnection>`