BasePoolableObjectFactory (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.dbcp.pool

## Class BasePoolableObjectFactory<T>

- java.lang.Object
- - org.apache.tomcat.dbcp.pool.BasePoolableObjectFactory<T>

- Type Parameters:
    `T` - the type of objects held in this pool
  All Implemented Interfaces:
    PoolableObjectFactory<T>

      public abstract class BasePoolableObjectFactory<T>
      extends Object
      implements PoolableObjectFactory<T>

  A base implementation of `PoolableObjectFactory`.

  All operations defined here are essentially no-op's.

  Since:
    Pool 1.0
  Author:
    Rodney Waldhoff
  See Also:
    `PoolableObjectFactory`, `BaseKeyedPoolableObjectFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePoolableObjectFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateObject(T obj)` No-op.
    `void` | `destroyObject(T obj)` No-op.
    `abstract T` | `makeObject()` Creates an instance that can be served by the pool.
    `void` | `passivateObject(T obj)` No-op.
    `boolean` | `validateObject(T obj)` This implementation always returns `true`.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BasePoolableObjectFactory

          public BasePoolableObjectFactory()

  - ### Method Detail

    - #### makeObject

          public abstract T makeObject()
                                throws Exception

      Creates an instance that can be served by the pool. Instances returned from this method should be in the same state as if they had been `activated`. They will not be activated before being served by the pool.
      Specified by:
        `makeObject` in interface `PoolableObjectFactory<T>`
      Returns:
        an instance that can be served by the pool.
      Throws:
        `Exception` - if there is a problem creating a new instance, this will be propagated to the code requesting an object.

    - #### destroyObject

          public void destroyObject(T obj)
                             throws Exception

      No-op.
      Specified by:
        `destroyObject` in interface `PoolableObjectFactory<T>`
      Parameters:
        `obj` - ignored
      Throws:
        `Exception` - should be avoided as it may be swallowed by the pool implementation.
      See Also:
        `PoolableObjectFactory.validateObject(T)`, `ObjectPool.invalidateObject(T)`

    - #### validateObject

          public boolean validateObject(T obj)

      This implementation always returns `true`.
      Specified by:
        `validateObject` in interface `PoolableObjectFactory<T>`
      Parameters:
        `obj` - ignored
      Returns:
        `true`

    - #### activateObject

          public void activateObject(T obj)
                              throws Exception

      No-op.
      Specified by:
        `activateObject` in interface `PoolableObjectFactory<T>`
      Parameters:
        `obj` - ignored
      Throws:
        `Exception` - if there is a problem activating `obj`, this exception may be swallowed by the pool.
      See Also:
        `PoolableObjectFactory.destroyObject(T)`

    - #### passivateObject

          public void passivateObject(T obj)
                               throws Exception

      No-op.
      Specified by:
        `passivateObject` in interface `PoolableObjectFactory<T>`
      Parameters:
        `obj` - ignored
      Throws:
        `Exception` - if there is a problem passivating `obj`, this exception may be swallowed by the pool.
      See Also:
        `PoolableObjectFactory.destroyObject(T)`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.