dbXML API

com.dbxml.util
Class ObjectPool

java.lang.Object
  extended bycom.dbxml.util.ObjectPool
Direct Known Subclasses:
DBFilerPool

public abstract class ObjectPool
extends java.lang.Object

ObjectPool is an abstract Object Pool implementation. In order to create a working ObjectPool, one must extend ObjectPool and implement the createObject method.


Constructor Summary
ObjectPool()
           
 
Method Summary
 Poolable getObject()
          getObject retrieves a Poolable object from the Object pool, creating a new instance if necessary.
 boolean isEmpty()
          isEmpty returns whether the ObjectPool is currently empty.
 void putObject(Poolable object)
          putObject should be called by Poolable objects or consumers of Poolable objects to return a Pooled object to the Object Pool.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPool

public ObjectPool()
Method Detail

getObject

public Poolable getObject()
getObject retrieves a Poolable object from the Object pool, creating a new instance if necessary.

Returns:
Poolable a Poolable object instance

putObject

public void putObject(Poolable object)
putObject should be called by Poolable objects or consumers of Poolable objects to return a Pooled object to the Object Pool.

Parameters:
object - The Poolable object instance

isEmpty

public boolean isEmpty()
isEmpty returns whether the ObjectPool is currently empty.

Returns:
Whether to ObjectPool is empty

dbXML API

Copyright (c) 2004 The dbXML Group