KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > pool > ObjectFactory


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.pool;
8
9 /**
10  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
11  */

12
13
14 public interface ObjectFactory {
15
16     Class JavaDoc getObjectClass();
17
18     /**
19      * create a new poolable object
20      *
21      * @return
22      */

23     PoolableObject makeObject() throws Exception JavaDoc;
24
25     /**
26      * destroy a poolabled object
27      *
28      * @param object
29      */

30     void destroyObject(PoolableObject object) throws Exception JavaDoc;
31
32     /**
33      * Ensures that the instance is safe to be returned by the pool
34      *
35      * @param object
36      * @return
37      */

38     boolean validateObject(PoolableObject object);
39
40 }
41
Popular Tags