hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/java/org/apache/hivemind/impl RegistryBuilder.java
Date Mon, 28 Feb 2005 12:19:28 GMT
jcarman     2005/02/28 04:19:28

  Modified:    framework/src/java/org/apache/hivemind/impl
                        RegistryBuilder.java
  Log:
  Added addDefaultModuleDescriptorProvider() convenience method.
  
  Revision  Changes    Path
  1.29      +13 -9     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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- RegistryBuilder.java	19 Feb 2005 02:40:53 -0000	1.28
  +++ RegistryBuilder.java	28 Feb 2005 12:19:02 -0000	1.29
  @@ -22,13 +22,9 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.apache.hivemind.ClassResolver;
   import org.apache.hivemind.ErrorHandler;
   import org.apache.hivemind.ModuleDescriptorProvider;
   import org.apache.hivemind.Registry;
  -import org.apache.hivemind.internal.ConfigurationPoint;
  -import org.apache.hivemind.internal.Contribution;
  -import org.apache.hivemind.internal.Module;
   import org.apache.hivemind.internal.RegistryInfrastructure;
   import org.apache.hivemind.parse.ModuleDescriptor;
   
  @@ -174,19 +170,27 @@
       }
   
       /**
  +     * Adds a default module descriptor provider to this <code>RegistryBuilder</code>.
 A
  +     * default module descriptor provider is merely a {@link XmlModuleDescriptorProvider}

  +     * constructed with a {@link DefaultClassResolver}.
  +     * @since 1.1
  +     */
  +    public void addDefaultModuleDescriptorProvider()
  +    {
  +        addModuleDescriptorProvider(new XmlModuleDescriptorProvider(new DefaultClassResolver()));
  +    }
  +    
  +    /**
        * Constructs a default registry based on just the modules visible to the thread context
class
        * loader (this is sufficient is the majority of cases), and using the default locale.
If you
        * have different error handling needs, or wish to pick up HiveMind module deployment
        * descriptors for non-standard locations, you must create a RegistryBuilder instance
yourself.
  +     * @see #addDefaultModuleDescriptorProvider()
        */
       public static Registry constructDefaultRegistry()
       {
  -        ClassResolver resolver = new DefaultClassResolver();
           RegistryBuilder builder = new RegistryBuilder();
  -        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver);
  -
  -        builder.addModuleDescriptorProvider(provider);
  -
  +        builder.addDefaultModuleDescriptorProvider();
           return builder.constructRegistry(Locale.getDefault());
       }
   
  
  
  

---------------------------------------------------------------------
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