Xindice API
version 1.1

org.apache.xindice.util
Class ObjectPool

java.lang.Object
  |
  +--org.apache.xindice.util.ObjectPool

public abstract class ObjectPool
extends Object

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

Version:
$Revision: 511426 $, $Date: 2007-02-24 22:25:02 -0500 (Sat, 24 Feb 2007) $

Constructor Summary
ObjectPool()
           
 
Method Summary
protected abstract  Poolable createObject()
          createObject needs to be implemented in order to allow the ObjectPool to produce Pooled objects.
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPool

public ObjectPool()
Method Detail

createObject

protected abstract Poolable createObject()
createObject needs to be implemented in order to allow the ObjectPool to produce Pooled objects.
Returns:
Poolable a new Poolable object instance

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

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.