org.apache.excalibur.mpool
Class FixedSizePool

java.lang.Object
  extended byorg.apache.excalibur.mpool.FixedSizePool
All Implemented Interfaces:
Disposable, Pool

public final class FixedSizePool
extends java.lang.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.4 $ $Date: 2004/02/28 11:47:34 $
Author:
Avalon Development Team

Constructor Summary
FixedSizePool(ObjectFactory factory, int size)
           
 
Method Summary
 java.lang.Object acquire()
          Acquire an instance of the pooled object.
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 java.lang.Object newInstance()
          Create a new instance of the object being pooled.
 void release(java.lang.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 java.lang.Exception
Method Detail

acquire

public java.lang.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(java.lang.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 java.lang.Object newInstance()
                             throws java.lang.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:
java.lang.Exception - if the instance cannot be created

dispose

public void dispose()
Description copied from interface: Disposable
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.

Specified by:
dispose in interface Disposable


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.