com.cafesoft.core.pool
Class DefaultPoolableObjectFactory

java.lang.Object
  |
  +--com.cafesoft.core.pool.DefaultPoolableObjectFactory
All Implemented Interfaces:
PoolableObjectFactory

public class DefaultPoolableObjectFactory
extends Object
implements PoolableObjectFactory

The DefaultPoolableObjectFactory provides a default implementation of the PoolableObjectFactory. This implementation is generic and thus involves only Object objects.

Since:
10/19/01

Constructor Summary
DefaultPoolableObjectFactory()
           
 
Method Summary
 Object createObject()
          Create a new object for the ObjectPool
 void destroyObject(Object object)
          Destroy an object that can no longer needed by the ObjectPool.
 boolean validateObject(Object object)
          Ensures that the Object is safe to be returned by the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPoolableObjectFactory

public DefaultPoolableObjectFactory()
Method Detail

createObject

public Object createObject()
                    throws Exception
Create a new object for the ObjectPool

Specified by:
createObject in interface PoolableObjectFactory
Returns:
A newly create object for insertion into the ObjectPool
Throws:
Exception - Throws an Exception if an error occurred while trying to create a new object

destroyObject

public void destroyObject(Object object)
Destroy an object that can no longer needed by the ObjectPool. All object resources should be released here.

Specified by:
destroyObject in interface PoolableObjectFactory
Parameters:
object - The object to be destroyed.

validateObject

public boolean validateObject(Object object)
Ensures that the Object is safe to be returned by the pool. Returns false if this object should be destroyed.

Specified by:
validateObject in interface PoolableObjectFactory
Parameters:
object - The object to be validated.
Returns:
false if this object is not valid and should be dropped from the pool, true otherwise.


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.