1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.pool;
19
20 /***
21 * A base implementation of <code>KeyedPoolableObjectFactory</code>.
22 * <p>
23 * All operations defined here are essentially no-op's.
24 *
25 * @see KeyedPoolableObjectFactory
26 *
27 * @author Rodney Waldhoff
28 * @version $Revision: 480413 $ $Date: 2006-11-28 22:16:05 -0700 (Tue, 28 Nov 2006) $
29 * @since Pool 1.0
30 */
31 public abstract class BaseKeyedPoolableObjectFactory implements KeyedPoolableObjectFactory {
32 public abstract Object makeObject(Object key)
33 throws Exception;
34
35 /*** No-op. */
36 public void destroyObject(Object key, Object obj)
37 throws Exception {
38 }
39
40 /***
41 * This implementation always returns <tt>true</tt>.
42 * @return <tt>true</tt>
43 */
44 public boolean validateObject(Object key, Object obj) {
45 return true;
46 }
47
48 /*** No-op. */
49 public void activateObject(Object key, Object obj)
50 throws Exception {
51 }
52
53 /*** No-op. */
54 public void passivateObject(Object key, Object obj)
55 throws Exception {
56 }
57 }