KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > component > DefaultComponentPool


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.component;
9
10 import org.apache.avalon.framework.activity.Initializable;
11 import org.apache.avalon.excalibur.pool.ObjectFactory;
12 import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool;
13 import org.apache.avalon.excalibur.pool.AbstractPool;
14 import org.apache.avalon.excalibur.pool.PoolController;
15
16 /**
17  * This is the implementation of <code>Pool</code> for Avalon
18  * Components that is thread safe. For Component Management, we need
19  * soft resource limiting due to the possibility of spikes in demand.
20  * This pool will destroy all unnecessary Components when they are
21  * no longer needed.
22  *
23  * @author <a HREF="mailto:bloritsch@apache.org">Berin Loritsch</a>
24  * @author <a HREF="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
25  * @version CVS $Revision: 1.3 $ $Date: 2001/12/11 09:53:27 $
26  * @since 4.0
27  */

28 public class DefaultComponentPool
29     extends SoftResourceLimitingPool
30     implements Initializable
31 {
32     /**
33      * Initialize the <code>Pool</code> with an
34      * <code>ObjectFactory</code>.
35      */

36     public DefaultComponentPool (ObjectFactory factory) throws Exception JavaDoc {
37         this(factory,
38               new DefaultComponentPoolController(
39                       AbstractPool.DEFAULT_POOL_SIZE / 4),
40               AbstractPool.DEFAULT_POOL_SIZE / 4,
41               AbstractPool.DEFAULT_POOL_SIZE);
42     }
43
44     /**
45      * Initialized the <code>Pool</code> with an alternative management
46      * infrastructure.
47      */

48     public DefaultComponentPool (ObjectFactory factory,
49                                  PoolController controller,
50                                  int minimumPoolSize,
51                                  int maximumPoolSIze)
52     throws Exception JavaDoc {
53         super(factory, controller, minimumPoolSize, maximumPoolSIze);
54     }
55 }
56
Popular Tags