intarsys runtime library

de.intarsys.tools.pool
Class GenericPool

java.lang.Object
  extended by de.intarsys.tools.pool.GenericPool
All Implemented Interfaces:
IPool

public class GenericPool
extends Object
implements IPool

A very simple implementation of a generic IPool.


Constructor Summary
GenericPool(IPoolObjectFactory objectFactory)
           
 
Method Summary
 void checkin(Object object)
          Add an object to the pool.
 Object checkout()
          Get an object from the pool.
 void close()
          Close the pool.
 void destroy(Object object)
          Destroy an object previously allocated from the pool.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericPool

public GenericPool(IPoolObjectFactory objectFactory)
Method Detail

checkin

public void checkin(Object object)
             throws Exception
Description copied from interface: IPool
Add an object to the pool.

Specified by:
checkin in interface IPool
Parameters:
object - The object to be added to the pool.
Throws:
Exception

checkout

public Object checkout()
                throws Exception
Description copied from interface: IPool
Get an object from the pool.

This may be a reused object or a new one, up to the pool strategy and size.

Specified by:
checkout in interface IPool
Returns:
A new object from the pool.
Throws:
Exception

close

public void close()
           throws Exception
Description copied from interface: IPool
Close the pool.

Specified by:
close in interface IPool
Throws:
Exception

destroy

public void destroy(Object object)
             throws Exception
Description copied from interface: IPool
Destroy an object previously allocated from the pool.

Specified by:
destroy in interface IPool
Parameters:
object - The object to be destroyed.
Throws:
Exception

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.