donaldp 01/04/01 17:13:57 Modified: src/java/org/apache/avalon/util/pool AbstractPool.java Resizable.java SingleThreadedPool.java Log: Fixed style niggles. Revision Changes Path 1.5 +22 -10 jakarta-avalon/src/java/org/apache/avalon/util/pool/AbstractPool.java Index: AbstractPool.java =================================================================== RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/util/pool/AbstractPool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AbstractPool.java 2001/03/16 19:46:48 1.4 +++ AbstractPool.java 2001/04/02 00:13:56 1.5 @@ -21,8 +21,10 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a> */ -public class AbstractPool extends AbstractLoggable implements Pool, ThreadSafe { - +public class AbstractPool + extends AbstractLoggable + implements Pool, ThreadSafe +{ protected final ObjectFactory m_factory; protected final int m_min; protected int m_max; @@ -44,9 +46,11 @@ if( min < 0 ) { - if (getLogger() != null) - getLogger().warn( "Minumum number of connections specified is " + + if( null != getLogger() ) + { + getLogger().warn( "Minumum number of poolables specified is " + "less than 0, using 0" ); + } t_min = 0; } @@ -57,10 +61,12 @@ if( ( max < min ) || ( max < 1 ) ) { - if (getLogger() != null) - getLogger().warn( "Maximum number of connections specified must be at " + + if( null != getLogger() ) + { + getLogger().warn( "Maximum number of poolables specified must be at " + "least 1 and must be greater than the minumum number " + "of connections" ); + } t_max = ( min > 1 ) ? min : 1; } else @@ -71,12 +77,14 @@ m_max = t_max; m_min = t_min; - if (! (this instanceof Initializable)) { + if( !(this instanceof Initializable) ) + { init(); } } - protected void init() throws Exception + protected void init() + throws Exception { for( int i = 0; i < m_min; i++ ) { @@ -107,8 +115,10 @@ m_active.addElement( obj ); - if (getLogger() != null) + if( null != getLogger() ) + { getLogger().debug( m_factory.getCreatedClass().getName() + ": requested from the pool." ); + } return obj; } @@ -118,7 +128,9 @@ m_active.removeElement( obj ); m_ready.push( obj ); - if (getLogger() != null) + if( null != getLogger() ) + { getLogger().debug( m_factory.getCreatedClass().getName() + ": returned to the pool." ); + } } } 1.2 +3 -3 jakarta-avalon/src/java/org/apache/avalon/util/pool/Resizable.java Index: Resizable.java =================================================================== RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/util/pool/Resizable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Resizable.java 2001/03/01 20:10:53 1.1 +++ Resizable.java 2001/04/02 00:13:56 1.2 @@ -12,8 +12,8 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a> */ -public interface Resizable { - +public interface Resizable +{ void grow(int amount); void shrink(int amount); -} \ No newline at end of file +} 1.3 +2 -1 jakarta-avalon/src/java/org/apache/avalon/util/pool/SingleThreadedPool.java Index: SingleThreadedPool.java =================================================================== RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/util/pool/SingleThreadedPool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SingleThreadedPool.java 2001/03/16 19:46:50 1.2 +++ SingleThreadedPool.java 2001/04/02 00:13:56 1.3 @@ -40,7 +40,8 @@ m_maximum = maximum; m_initial = initial; - if (! (this instanceof Initializable)) { + if( !(this instanceof Initializable) ) + { init(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]