org.apache.excalibur.mpool
Class FixedSizePool

java.lang.Object
  |
  +--org.apache.excalibur.mpool.FixedSizePool
All Implemented Interfaces:
Disposable, Pool

public final class FixedSizePool
extends Object
implements Pool, Disposable

This is an Pool that caches Poolable objects for reuse. Please note that this pool offers no resource limiting whatsoever.

Since:
4.1
Version:
CVS $Revision: 1.13 $ $Date: 2003/03/22 12:46:28 $
Author:
Berin Loritsch

Constructor Summary
FixedSizePool(ObjectFactory factory, int size)
           
 
Method Summary
 Object acquire()
          Acquire an instance of the pooled object.
 void dispose()
           
 Object newInstance()
          Create a new instance of the object being pooled.
 void release(Object object)
          Release the instance of the pooled object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedSizePool

public FixedSizePool(ObjectFactory factory,
                     int size)
              throws Exception
Method Detail

acquire

public Object acquire()
Description copied from interface: Pool
Acquire an instance of the pooled object.

Specified by:
acquire in interface Pool
Returns:
the pooled Object instance

release

public void release(Object object)
Description copied from interface: Pool
Release the instance of the pooled object.

Specified by:
release in interface Pool
Parameters:
object - The pooled object to release to the pool.

newInstance

public Object newInstance()
                   throws Exception
Description copied from interface: Pool
Create a new instance of the object being pooled.

Specified by:
newInstance in interface Pool
Returns:
the pooled Object instance
Throws:
Exception - if the instance cannot be created

dispose

public void dispose()
Specified by:
dispose in interface Disposable


Copyright © 2002 Apache Avalon Project. All Rights Reserved.