1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.jencks.factory;
18
19 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
20 import org.springframework.beans.factory.FactoryBean;
21 import org.springframework.beans.factory.InitializingBean;
22
23 /***
24 * This FactoryBean creates the partitionned pool strategy for
25 * the Geronimo connection manager.
26 * <p/>
27 * This class is based on the common pool properties defined in
28 * the AbstractGeronimoPool class.
29 *
30 * @author Thierry Templier
31 * @see SinglePool
32 * @see AbstractGeronimoPool
33 * @see ConnectionManagerFactoryBean#setPoolingSupport(PoolingSupport)
34 */
35 public class SinglePoolFactoryBean extends AbstractGeronimoPool implements FactoryBean, InitializingBean {
36
37 private SinglePool pool;
38
39 public Object getObject() throws Exception {
40 return pool;
41 }
42
43 public Class getObjectType() {
44 return SinglePool.class;
45 }
46
47 public boolean isSingleton() {
48 return true;
49 }
50
51 public void afterPropertiesSet() throws Exception {
52 this.pool = new SinglePool(maxSize, minSize, blockingTimeoutMilliseconds,
53 idleTimeoutMinutes, matchOne, matchAll, selectOneAssumeMatch);
54 }
55
56 }