1 8 package org.apache.avalon.excalibur.component; 9 10 import org.apache.avalon.framework.thread.ThreadSafe; 11 import org.apache.avalon.excalibur.pool.PoolController; 12 13 22 public class DefaultComponentPoolController 23 implements PoolController, ThreadSafe 24 { 25 26 public static final int DEFAULT_AMOUNT = 8; 27 28 29 protected final int m_amount; 30 31 35 public DefaultComponentPoolController() 36 { 37 m_amount = DefaultComponentPoolController.DEFAULT_AMOUNT; 38 } 39 40 47 public DefaultComponentPoolController( final int amount ) 48 { 49 if ( amount > 0 ) 50 { 51 m_amount = amount; 52 } 53 else 54 { 55 m_amount = DefaultComponentPoolController.DEFAULT_AMOUNT; 56 } 57 } 58 59 65 public int grow() 66 { 67 return m_amount; 68 } 69 70 76 public int shrink() 77 { 78 return m_amount; 79 } 80 } 81 | Popular Tags |