org.apache.excalibur.mpool
Class VariableSizePool

java.lang.Object
  extended by org.apache.excalibur.mpool.VariableSizePool
All Implemented Interfaces:
Disposable, ManagablePool, Pool

public final class VariableSizePool
extends java.lang.Object
implements Pool, Disposable, ManagablePool

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
VariableSizePool(ObjectFactory factory, int size)
          Constructor for an unmanaged pool
VariableSizePool(ObjectFactory factory, int size, long key)
          Constructor for a managed pool
 
Method Summary
 java.lang.Object acquire()
           
 void dispose()
           
 void grow(int byNum, long key)
           
 java.lang.Object newInstance()
           
 void release(java.lang.Object pooledObject)
           
 void shrink(int byNum, long key)
           
 int size(long key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableSizePool

public VariableSizePool(ObjectFactory factory,
                        int size)
                 throws java.lang.Exception
Constructor for an unmanaged pool

Throws:
java.lang.Exception

VariableSizePool

public VariableSizePool(ObjectFactory factory,
                        int size,
                        long key)
                 throws java.lang.Exception
Constructor for a managed pool

Throws:
java.lang.Exception
Method Detail

acquire

public java.lang.Object acquire()
                         throws java.lang.Exception
Specified by:
acquire in interface Pool
Throws:
java.lang.Exception

release

public void release(java.lang.Object pooledObject)
Specified by:
release in interface Pool

newInstance

public java.lang.Object newInstance()
                             throws java.lang.Exception
Specified by:
newInstance in interface Pool
Throws:
java.lang.Exception

dispose

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

shrink

public void shrink(int byNum,
                   long key)
            throws java.lang.IllegalAccessException
Specified by:
shrink in interface ManagablePool
Throws:
java.lang.IllegalAccessException

grow

public void grow(int byNum,
                 long key)
          throws java.lang.IllegalAccessException
Specified by:
grow in interface ManagablePool
Throws:
java.lang.IllegalAccessException

size

public int size(long key)
         throws java.lang.IllegalAccessException
Specified by:
size in interface ManagablePool
Throws:
java.lang.IllegalAccessException


Copyright © 2011 Apache Software Foundation. All Rights Reserved.