org.scopemvc.util
Class ObjectPoolManager

java.lang.Object
  |
  +--org.scopemvc.util.ObjectPoolManager

public class ObjectPoolManager
extends java.lang.Object

Manages pooling of instances of different classes.

Version:
$Revision: 1.5 $ $Date: 2002/09/05 15:41:46 $
Author:
Simon Harris

Method Summary
 void addObjectPool(java.lang.Class clazz, ObjectPool pool)
          Adds a pool to be managed.
 java.lang.Object borrowObject(java.lang.Class clazz)
          Obtains an instance of the sepcified class from the pool.
 java.lang.Object borrowObjectIfExists(java.lang.Class clazz)
          Obtains an instance of the specified class from the pool.
static ObjectPoolManager getInstance()
          Obtains the singleton instance of this class.
 ObjectPool getObjectPool(java.lang.Class clazz)
          Obtains the pool for the given class
 void returnObject(java.lang.Object object)
          Returns an instance to the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ObjectPoolManager getInstance()
Obtains the singleton instance of this class.

Returns:
The instance value

getObjectPool

public final ObjectPool getObjectPool(java.lang.Class clazz)
Obtains the pool for the given class

Parameters:
clazz - TODO: Describe the Parameter
Returns:
The objectPool value

borrowObject

public final java.lang.Object borrowObject(java.lang.Class clazz)
Obtains an instance of the sepcified class from the pool. Blocks if no free instances.

Parameters:
clazz - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

borrowObjectIfExists

public final java.lang.Object borrowObjectIfExists(java.lang.Class clazz)
Obtains an instance of the specified class from the pool. Returns null if no free instances.

Parameters:
clazz - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

returnObject

public final void returnObject(java.lang.Object object)
Returns an instance to the pool.

Parameters:
object - TODO: Describe the Parameter

addObjectPool

public final void addObjectPool(java.lang.Class clazz,
                                ObjectPool pool)
Adds a pool to be managed.

Parameters:
clazz - The element to be added to the ObjectPool attribute
pool - The element to be added to the ObjectPool attribute


Copyright © 2000-2002 The Scope Team. All Rights Reserved.