© 2005 BEA Systems, Inc.

com.beasys.commerce.util
Class Pool

java.lang.Object
  extended bycom.beasys.commerce.util.Pool

public class Pool
extends Object

A generic object pooling class.


Constructor Summary
Pool(PoolMemberFactory factory, int size)
          Standard constructor.
 
Method Summary
 Object getInstance()
          Provide a free member of the pool.
 void returnInstance(Object memberObject)
          Return a member of the pool to available status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pool

public Pool(PoolMemberFactory factory,
            int size)
Standard constructor.

Method Detail

getInstance

public Object getInstance()
Provide a free member of the pool. Mark the member as in use.

Returns:
the free pool member

returnInstance

public void returnInstance(Object memberObject)
Return a member of the pool to available status.

Parameters:
memberObject - the object to return

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved