01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.pool;
09:
10: /**
11: *
12: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
13: */
14:
15: public interface ObjectFactory {
16:
17: Class getObjectClass();
18:
19: /**
20: * create a new poolable object
21: * @return
22: */
23: PoolableObject makeObject() throws Exception;
24:
25: /**
26: * destroy a poolabled object
27: * @param object
28: */
29: void destroyObject(PoolableObject object) throws Exception;
30:
31: /**
32: * Ensures that the instance is safe to be returned by the pool
33: * @param object
34: * @return
35: */
36: boolean validateObject(PoolableObject object);
37:
38: }
|