commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bradley M. Handy" <brad.ha...@williamstonfmc.org>
Subject [pool] Source submission
Date Sun, 08 Jun 2003 03:17:19 GMT
I have source code for two classes I would like to submit, because I feel 
they would be useful to the commons-pool project.  One is an implementation 
of "PoolableObjectFactory" and the other is a test case for the 
implementation class.

The "PoolableObjectFactory" implementation is called 
"GenericPoolableObjectFactory".  It has to constructors.  The first 
constructor take a parameter of type java.lang.Class representing the class 
of object to be pooled.  The second constructor takes a java.lang.Class 
argument and a java.util.Map argument.  The Map contains a list of keys 
which correspond to properties of the type of object to be pooled which 
will be copied to a newly created object after instantiation using 
Class.newInstance().

The "activeObject", "destroyObject", "passivateObject" and "validateObject" 
methods use reflection to execute a method on the pooled objects.


Factory Method  -> Pooled Object Method

public void activeObject(Object o) throws Exception  -> public void 
activate() throws Exception
public void destroyObject(Object o) throws Exception -> public void 
destroy() throws Exception
public void passivateObject(Object o) throws Exception -> public void 
passivate() throws Exception
public void validateObject() -> public void validate()


Brad Handy


Mime
View raw message