com.boylesoftware.cb2.util.pool
Class SimplePooledObjectFactory

java.lang.Object
  extended bycom.boylesoftware.cb2.util.pool.PooledObjectFactoryAdapter
      extended bycom.boylesoftware.cb2.util.pool.SimplePooledObjectFactory
All Implemented Interfaces:
PooledObjectFactory

public class SimplePooledObjectFactory
extends PooledObjectFactoryAdapter

Simple pooled object factory implementation, which creates instances of a specified during initialization class using its default constructor.

Version:
$Id: SimplePooledObjectFactory.java,v 1.3 2003/07/23 22:18:08 levahim Exp $
Author:
Lev Himmelfarb

Field Summary
protected  java.lang.Class theClass
          The objects' class.
 
Fields inherited from class com.boylesoftware.cb2.util.pool.PooledObjectFactoryAdapter
pool
 
Constructor Summary
SimplePooledObjectFactory(java.lang.Class theClass)
          Constructs a factory.
 
Method Summary
 java.lang.Object createObject()
          Instantiates an object for a pool.
 
Methods inherited from class com.boylesoftware.cb2.util.pool.PooledObjectFactoryAdapter
destroyObject, resetObject, setPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theClass

protected final java.lang.Class theClass
The objects' class.

Constructor Detail

SimplePooledObjectFactory

public SimplePooledObjectFactory(java.lang.Class theClass)
Constructs a factory.

Parameters:
theClass - class of the objects this factory will be instantiating.
Method Detail

createObject

public java.lang.Object createObject()
Instantiates an object for a pool.

Returns:
the new object instance.
Throws:
java.lang.RuntimeException - if the object cannot be instantiated.


Copyright © 2002,2003,2004 - Boyle Software, Inc.