bloritsch    02/02/07 13:58:19

  Modified:    src/scratchpad/org/apache/avalon/excalibur/pool
                        DefaultPoolManager.java
               src/scratchpad/org/apache/avalon/excalibur/system
                        AbstractContainer.java
               src/scratchpad/org/apache/avalon/excalibur/system/handler
                        FactoryComponentHandler.java
                        PerThreadComponentHandler.java
                        PoolableComponentHandler.java
                        ThreadSafeComponentHandler.java
  Log:
  fix some classloader issues with Handlers, and slow startup
  
  Revision  Changes    Path
  1.6       +4 -4      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/pool/DefaultPoolManager.java
  
  Index: DefaultPoolManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/pool/DefaultPoolManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultPoolManager.java   28 Jan 2002 19:29:47 -0000      1.5
  +++ DefaultPoolManager.java   7 Feb 2002 21:58:19 -0000       1.6
  @@ -7,13 +7,13 @@
    */
   package org.apache.avalon.excalibur.pool;
   
  -import java.security.SecureRandom;
   import org.apache.avalon.excalibur.command.RepeatedCommand;
   import org.apache.avalon.excalibur.event.Queue;
   
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
  +import java.util.Random;
   
   /**
    * This interface is for a PoolManager that creates pools that are managed
  @@ -21,13 +21,13 @@
    * the constructor.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.5 $ $Date: 2002/01/28 19:29:47 $
  + * @version CVS $Revision: 1.6 $ $Date: 2002/02/07 21:58:19 $
    * @since 4.1
    */
   public class DefaultPoolManager implements PoolManager
   {
       private final long          m_managerKey;
  -    private final SecureRandom  m_keyGenerator;
  +    private final Random        m_keyGenerator;
       private final HashMap       m_keyMap = new HashMap();
       private final HashMap       m_factoryMap = new HashMap();
   
  @@ -38,7 +38,7 @@
   
       public DefaultPoolManager( final Queue commandQueue )
       {
  -        m_keyGenerator = new SecureRandom();
  +        m_keyGenerator = new Random();
           m_managerKey = m_keyGenerator.nextLong();
   
           if ( null != commandQueue )
  
  
  
  1.15      +7 -2      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/AbstractContainer.java
  
  Index: AbstractContainer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/AbstractContainer.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AbstractContainer.java    7 Feb 2002 17:41:35 -0000       1.14
  +++ AbstractContainer.java    7 Feb 2002 21:58:19 -0000       1.15
  @@ -36,7 +36,7 @@
    * Manager can expose that to the instantiating class.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.14 $ $Date: 2002/02/07 17:41:35 $
  + * @version CVS $Revision: 1.15 $ $Date: 2002/02/07 21:58:19 $
    */
   public abstract class AbstractContainer
      extends AbstractLogEnabled
  @@ -174,7 +174,7 @@
                   catch ( Exception e )
                   {
                       getLogger().debug( "It appears that the configuration 
element " +
  -                                       components[ i ] + " was not a 
Component" );
  +                                       components[ i ].getName() + " was not 
a Component" );
                   }
               }
           }
  @@ -221,6 +221,11 @@
       protected void assignHandler( ComponentHandler handler, Configuration 
config, Map managerMap )
           throws ConfigurationException
       {
  +        if ( null == handler )
  +        {
  +            throw new ConfigurationException("The ComponentHandler passed in 
was null");
  +        }
  +
           m_components.add( handler );
           m_configs.put( handler, config );
           String role = config.getAttribute( "role" );
  
  
  
  1.4       +3 -3      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/FactoryComponentHandler.java
  
  Index: FactoryComponentHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/FactoryComponentHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FactoryComponentHandler.java      5 Feb 2002 14:15:04 -0000       1.3
  +++ FactoryComponentHandler.java      7 Feb 2002 21:58:19 -0000       1.4
  @@ -23,10 +23,10 @@
    * and destroyed correctly.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/02/05 14:15:04 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/02/07 21:58:19 $
    * @since 4.0
    */
  -class FactoryComponentHandler
  +public final class FactoryComponentHandler
       implements ComponentHandler
   {
       /** The instance of the ComponentFactory that creates and disposes of 
the Component */
  @@ -46,7 +46,7 @@
        * whether a Component is ThreadSafe, Poolable, or SingleThreaded.
        * It falls back to SingleThreaded if not specified.
        */
  -    protected FactoryComponentHandler( final Class componentClass,
  +    public FactoryComponentHandler( final Class componentClass,
                                          final Configuration config,
                                          final ComponentManager manager,
                                          final Context context )
  
  
  
  1.4       +3 -3      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/PerThreadComponentHandler.java
  
  Index: PerThreadComponentHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/PerThreadComponentHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PerThreadComponentHandler.java    29 Jan 2002 16:18:53 -0000      1.3
  +++ PerThreadComponentHandler.java    7 Feb 2002 21:58:19 -0000       1.4
  @@ -23,10 +23,10 @@
    * and destroyed correctly.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/29 16:18:53 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/02/07 21:58:19 $
    * @since 4.0
    */
  -public class PerThreadComponentHandler implements ComponentHandler {
  +public final class PerThreadComponentHandler implements ComponentHandler {
       private ThreadLocalComponent m_instance;
       private final ComponentFactory m_factory;
       private boolean m_initialized = false;
  @@ -38,7 +38,7 @@
        * whether a Component is ThreadSafe, Poolable, or SingleThreaded.
        * It falls back to SingleThreaded if not specified.
        */
  -    protected PerThreadComponentHandler ( final Class componentClass,
  +    public PerThreadComponentHandler ( final Class componentClass,
                                             final Configuration config,
                                             final ComponentManager manager,
                                             final Context context )
  
  
  
  1.4       +3 -3      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/PoolableComponentHandler.java
  
  Index: PoolableComponentHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/PoolableComponentHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PoolableComponentHandler.java     29 Jan 2002 16:18:53 -0000      1.3
  +++ PoolableComponentHandler.java     7 Feb 2002 21:58:19 -0000       1.4
  @@ -26,10 +26,10 @@
    * and destroyed correctly.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/29 16:18:53 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/02/07 21:58:19 $
    * @since 4.0
    */
  -public class PoolableComponentHandler implements ComponentHandler {
  +public final class PoolableComponentHandler implements ComponentHandler {
       /** The instance of the ComponentFactory that creates and disposes of 
the Component */
       private final ComponentFactory    m_factory;
   
  @@ -51,7 +51,7 @@
        * whether a Component is ThreadSafe, Poolable, or SingleThreaded.
        * It falls back to SingleThreaded if not specified.
        */
  -    protected PoolableComponentHandler( final Class componentClass,
  +    public PoolableComponentHandler( final Class componentClass,
                                           final Configuration config,
                                           final ComponentManager manager,
                                           final Context context )
  
  
  
  1.4       +3 -3      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/ThreadSafeComponentHandler.java
  
  Index: ThreadSafeComponentHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/handler/ThreadSafeComponentHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThreadSafeComponentHandler.java   29 Jan 2002 16:18:53 -0000      1.3
  +++ ThreadSafeComponentHandler.java   7 Feb 2002 21:58:19 -0000       1.4
  @@ -23,10 +23,10 @@
    * and destroyed correctly.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/29 16:18:53 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/02/07 21:58:19 $
    * @since 4.0
    */
  -public class ThreadSafeComponentHandler implements ComponentHandler {
  +public final class ThreadSafeComponentHandler implements ComponentHandler {
       private Component m_instance;
       private final ComponentFactory m_factory;
       private boolean m_initialized = false;
  @@ -38,7 +38,7 @@
        * whether a Component is ThreadSafe, Poolable, or SingleThreaded.
        * It falls back to SingleThreaded if not specified.
        */
  -    protected ThreadSafeComponentHandler( final Class componentClass,
  +    public ThreadSafeComponentHandler( final Class componentClass,
                                             final Configuration config,
                                             final ComponentManager manager,
                                             final Context context )
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to