hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/java/org/apache/hivemind/servlet HiveMindFilter.java
Date Tue, 28 Sep 2004 10:24:02 GMT
knut        2004/09/28 03:24:02

  Modified:    framework/src/test/hivemind/test/config
                        TestConfigurationPoint.java
               framework/src/java/org/apache/hivemind/impl
                        XmlModuleDescriptorProvider.java
                        RegistryBuilder.java
               framework/src/java/org/apache/hivemind/test
                        HiveMindTestCase.java
               examples/src/java/org/apache/hivemind/examples
                        ExampleUtils.java
               framework/src/test/hivemind/test TestRegistryBuilder.java
               framework/src/java/org/apache/hivemind/servlet
                        HiveMindFilter.java
  Log:
  added convenience constructor to XmlModuleDescriptorProvider for locating default hivemodule.xml
resources on classpath
  
  Revision  Changes    Path
  1.23      +1 -2      jakarta-hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java
  
  Index: TestConfigurationPoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TestConfigurationPoint.java	27 Sep 2004 15:50:47 -0000	1.22
  +++ TestConfigurationPoint.java	28 Sep 2004 10:24:02 -0000	1.23
  @@ -422,8 +422,7 @@
           Resource moduleResource = new ClasspathResource(_resolver,
                   "/hivemind/test/config/ResourceTranslator.xml");
   
  -        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML));
  +        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver));
           builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver,
                   moduleResource));
   
  
  
  
  1.2       +15 -9     jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProvider.java
  
  Index: XmlModuleDescriptorProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XmlModuleDescriptorProvider.java	27 Sep 2004 15:50:47 -0000	1.1
  +++ XmlModuleDescriptorProvider.java	28 Sep 2004 10:24:02 -0000	1.2
  @@ -17,7 +17,6 @@
   import java.io.IOException;
   import java.net.URL;
   import java.util.ArrayList;
  -import java.util.Collection;
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.List;
  @@ -73,6 +72,16 @@
       private ClassResolver _resolver;
   
       /**
  +     * Convenience constructor. Equivalent to using
  +     * {@link #XmlModuleDescriptorProvider(ClassResolver, String)}with {@link #HIVE_MODULE_XML}as
  +     * the second argument.
  +     */
  +    public XmlModuleDescriptorProvider(ClassResolver resolver)
  +    {
  +        this(resolver, HIVE_MODULE_XML);
  +    }
  +
  +    /**
        * Loads all XML module descriptors found on the classpath (using the given
        * {@link org.apache.hivemind.ClassResolver}. Only module descriptors matching the
specified
        * path are loaded. Use the {@link XmlModuleDescriptorProvider#HIVE_MODULE_XML}constant
to load
  @@ -174,11 +183,13 @@
               RegistryAssembly assembly)
       {
           List subModules = moduleDescriptor.getSubModules();
  -        int count = size(subModules);
   
  -        for (int i = 0; i < count; i++)
  +        if (subModules == null)
  +            return;
  +
  +        for (Iterator i = subModules.iterator(); i.hasNext();)
           {
  -            SubModuleDescriptor smd = (SubModuleDescriptor) subModules.get(i);
  +            SubModuleDescriptor smd = (SubModuleDescriptor) i.next();
   
               Resource descriptorResource = smd.getDescriptor();
   
  @@ -191,11 +202,6 @@
   
               processModule(smd.getDescriptor(), handler, assembly);
           }
  -    }
  -
  -    private static int size(Collection c)
  -    {
  -        return c == null ? 0 : c.size();
       }
   
   }
  
  
  
  1.24      +1 -2      jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
  
  Index: RegistryBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- RegistryBuilder.java	27 Sep 2004 15:50:47 -0000	1.23
  +++ RegistryBuilder.java	28 Sep 2004 10:24:02 -0000	1.24
  @@ -185,8 +185,7 @@
       {
           ClassResolver resolver = new DefaultClassResolver();
           RegistryBuilder builder = new RegistryBuilder();
  -        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML);
  +        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver);
   
           builder.addModuleDescriptorProvider(provider);
           
  
  
  
  1.16      +1 -2      jakarta-hivemind/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java
  
  Index: HiveMindTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- HiveMindTestCase.java	27 Sep 2004 15:50:47 -0000	1.15
  +++ HiveMindTestCase.java	28 Sep 2004 10:24:02 -0000	1.16
  @@ -379,8 +379,7 @@
   
           RegistryBuilder builder = new RegistryBuilder();
   
  -        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML));
  +        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));
           builder.addModuleDescriptorProvider(customProvider);
   
           return builder.constructRegistry(Locale.getDefault());
  
  
  
  1.6       +1 -2      jakarta-hivemind/examples/src/java/org/apache/hivemind/examples/ExampleUtils.java
  
  Index: ExampleUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/examples/src/java/org/apache/hivemind/examples/ExampleUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ExampleUtils.java	27 Sep 2004 15:50:47 -0000	1.5
  +++ ExampleUtils.java	28 Sep 2004 10:24:02 -0000	1.6
  @@ -48,8 +48,7 @@
           ClassResolver resolver = new DefaultClassResolver();
           RegistryBuilder builder = new RegistryBuilder();
   
  -        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML));
  +        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));
   
           // Register the examples.xml file, which (given its non-standard name)
           // is not visible.
  
  
  
  1.19      +1 -2      jakarta-hivemind/framework/src/test/hivemind/test/TestRegistryBuilder.java
  
  Index: TestRegistryBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/TestRegistryBuilder.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TestRegistryBuilder.java	27 Sep 2004 15:50:47 -0000	1.18
  +++ TestRegistryBuilder.java	28 Sep 2004 10:24:02 -0000	1.19
  @@ -59,8 +59,7 @@
   
           RegistryBuilder b = new RegistryBuilder();
   
  -        b.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML));
  +        b.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));
   
           Registry r = b.constructRegistry(Locale.getDefault());
   
  
  
  
  1.13      +1 -2      jakarta-hivemind/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java
  
  Index: HiveMindFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HiveMindFilter.java	27 Sep 2004 15:50:47 -0000	1.12
  +++ HiveMindFilter.java	28 Sep 2004 10:24:02 -0000	1.13
  @@ -122,8 +122,7 @@
        */
       protected ModuleDescriptorProvider getModuleDescriptorProvider(ClassResolver resolver)
       {
  -        return new XmlModuleDescriptorProvider(resolver,
  -                XmlModuleDescriptorProvider.HIVE_MODULE_XML);
  +        return new XmlModuleDescriptorProvider(resolver);
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message