hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r413747 [3/4] - in /jakarta/hivemind/branches/branch-2-0-annot: ./ examples/src/java/org/apache/examples/ framework/src/descriptor/META-INF/ framework/src/java/org/apache/hivemind/ framework/src/java/org/apache/hivemind/ant/ framework/src/j...
Date Mon, 12 Jun 2006 21:44:58 GMT
Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java Mon Jun 12 14:44:52 2006
@@ -14,7 +14,6 @@
 
 package org.apache.hivemind.internal;
 
-import java.util.List;
 
 /**
  * An Contribution is a contribution to an {@link org.apache.hivemind.internal.ConfigurationPoint}.
@@ -24,15 +23,8 @@
 public interface Contribution
 {
     /**
-     * Returns the module which made this contribution.
+     * Contributes to the Configuration. A container is handed in to which new 
+     * entries can be added.
      */
-    public Module getContributingModule();
-
-    /**
-     * Returns a List of {@link org.apache.hivemind.Element}, the representation of the XML
-     * elements in the extension. The ConfigurationPoint will use its
-     * {@link org.apache.hivemind.schema.Schema} (if present) to convert this XML representation
-     * into the object representation returned by {@link ConfigurationPoint#getElements()}.
-     */
-    public List getElements();
+    public void contribute(ConfigurationPoint configurationPoint, Object container);
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ExtensionPoint.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ExtensionPoint.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ExtensionPoint.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ExtensionPoint.java Mon Jun 12 14:44:52 2006
@@ -60,4 +60,17 @@
      */
 
     public ErrorLog getErrorLog();
+    
+    /**
+     * Adds a new nature to the extension point (comparable to an eclipse project nature).
+     * A nature is a decorator class which can store additional information and offer
+     * specific functionality.
+     */
+    public void addNature(Class natureType, Object nature);
+    
+    /**
+     * Retrieves a nature that has been added by {@link #addNature(Class, Object)}
+     */
+    public Object getNature(Class natureType);
+    
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java Mon Jun 12 14:44:52 2006
@@ -14,17 +14,15 @@
 
 package org.apache.hivemind.internal;
 
-import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
+import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.ClassResolver;
 import org.apache.hivemind.ErrorHandler;
 import org.apache.hivemind.Locatable;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.Messages;
 import org.apache.hivemind.SymbolSource;
-import org.apache.hivemind.schema.Translator;
 
 /**
  * The definition of a HiveMind Module. A Module is a container of service extension points and
@@ -90,11 +88,7 @@
     public ServicePoint getServicePoint(String serviceId);
 
     /**
-     * Returns the {@link java.util.List} of elements for the specified configuration point. The
-     * returned List is unmodifiable. It may be empty, but won't be null.
-     * <p>
-     * It is expressly the <em>caller's</em> job to sort the elements into an appropriate order (a
-     * copy will have to be made since the returned List is unmodifiable).
+     * Returns the container for the specified configuration point. 
      * 
      * @param configurationId
      *            an unqualified id for a configuration within this module, or a fully qualified id
@@ -102,32 +96,7 @@
      * @throws ApplicationRuntimeException
      *             if this module does not contain the specified configuration extension point.
      */
-    public List getConfiguration(String configurationId);
-
-    /**
-     * Returns true if the elements contributed to the given configuration point can be
-     * {@link #getConfigurationAsMap(String) retrieved as a Map}.
-     * 
-     * @see ConfigurationPoint#areElementsMappable()
-     * @since 1.1
-     */
-    public boolean isConfigurationMappable(String configurationId);
-
-    /**
-     * Returns the elements of the given configuration point as an unmodifiable {@link Map}. It may
-     * be empty, but not null.
-     * 
-     * @param configurationId
-     *            an unqualified id for a configuration within this module, or a fully qualified id
-     *            for a configuration in this or any other module.
-     * @throws ApplicationRuntimeException
-     *             if no configuration point with the given id exists or if the elements can't be
-     *             mapped.
-     * @see ConfigurationPoint#getElementsAsMap()
-     * @see #isConfigurationMappable(String)
-     * @since 1.1
-     */
-    public Map getConfigurationAsMap(String configurationId);
+    public Object getConfiguration(String configurationId);
 
     /**
      * Returns the resource resolver for this module. The resource resolver is used to locate
@@ -159,11 +128,6 @@
     public Messages getMessages();
 
     /**
-     * @see RegistryInfrastructure#getTranslator(String)
-     */
-    public Translator getTranslator(String translator);
-
-    /**
      * @see RegistryInfrastructure#getServiceModelFactory(String)
      */
     public ServiceModelFactory getServiceModelFactory(String name);
@@ -183,4 +147,18 @@
      */
 
     public ErrorHandler getErrorHandler();
+    
+    /**
+     * Retrieves a registry nature.
+     * @see RegistryInfrastructure#addNature(Class, Object)
+     */
+    public Object getRegistryNature(Class natureType);
+    
+    /**
+     * Retrieves another module from the registry.
+     * @param moduleId
+     * @return the module
+     */
+    public Module getModule(String moduleId);
+    
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/RegistryInfrastructure.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/RegistryInfrastructure.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/RegistryInfrastructure.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/RegistryInfrastructure.java Mon Jun 12 14:44:52 2006
@@ -16,12 +16,10 @@
 
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
 import org.apache.hivemind.ErrorHandler;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.SymbolSource;
-import org.apache.hivemind.schema.Translator;
 
 /**
  * Extension of {@link org.apache.hivemind.Registry} provided by some internals of HiveMind to
@@ -65,53 +63,19 @@
     public Object getService(Class serviceInterface, Module module);
 
     /**
-     * Returns the converted items contributed to the configuration point.
+     * Returns the containter of the specified configuration point.
      * 
      * @param configurationId
      *            the fully qualified id of the configuration
      * @param module
      *            the referencing module, used for visibility checks (null means no module, which
      *            requires that the configuration be public)
-     * @return List of converted elements
+     * @return  configuration container
      * @throws org.apache.hivemind.ApplicationRuntimeException
      *             if no such configuration extension point exists (or visible)
      */
 
-    public List getConfiguration(String configurationId, Module module);
-
-    /**
-     * Returns true if the elements contributed to the given configuration point can be
-     * {@link #getConfigurationAsMap(String) retrieved as a Map}.
-     * 
-     * @param configurationId
-     *            the fully qualified id of the configuration
-     * @param module
-     *            the referencing module, used for visibility checks (null means no module, which
-     *            requires that the configuration be public)
-     * @throws ApplicationRuntimeException
-     *             if no visible configuration point with the given id exists
-     * @see Module#isConfigurationMappable(String)
-     * @since 1.1
-     */
-    public boolean isConfigurationMappable(String configurationId, Module module);
-
-    /**
-     * Returns the elements of the given configuration point as an unmodifiable {@link Map}. It may
-     * be empty, but not null.
-     * 
-     * @param configurationId
-     *            the fully qualified id of the configuration
-     * @param module
-     *            the referencing module, used for visibility checks (null means no module, which
-     *            requires that the configuration be public)
-     * @throws ApplicationRuntimeException
-     *             if no visible configuration point with the given id exists or if the elements
-     *             can't be mapped.
-     * @see Module#getConfigurationAsMap(String)
-     * @see #isConfigurationMappable(String)
-     * @since 1.1
-     */
-    public Map getConfigurationAsMap(String configurationId, Module module);
+    public Object getConfiguration(String configurationId, Module module);
 
     /**
      * Returns the configuration point.
@@ -162,22 +126,6 @@
     public ServiceModelFactory getServiceModelFactory(String name);
 
     /**
-     * Gets a {@link Translator} instance. The Translator may be a shared, cached instance
-     * (Translators should be stateless). Translators are identified by a constructor, which may be
-     * the name of a translator defined in the <code>hivemind.Translators</code> extension point
-     * (a single builtin translator, <code>class</code>, is hardcoded). Alternately, the name may
-     * consist of a translator name, a comma, and an initializer string for the service (example:
-     * <code>int,min=5</code>).
-     * 
-     * @param constructor
-     *            the name and optional initialization of a Translator
-     * @return a {@link Translator} instance
-     * @throws ApplicationRuntimeException
-     *             if the translator can not be constructed (i.e., the name is not known)
-     */
-    public Translator getTranslator(String constructor);
-
-    /**
      * Returns the locale for which the registry was created.
      */
 
@@ -281,4 +229,17 @@
      * @return the module with the corresponding module id
      */
     public Module getModule(String moduleId);
+    
+    /**
+     * Adds a new nature to the registry (comparable to an eclipse project nature).
+     * A nature is a decorator class which can store additional information and offer
+     * specific functionality.
+     */
+    public void addNature(Class natureType, Object nature);
+    
+    /**
+     * Retrieves a nature that has been added by {@link #addNature(Class, Object)}
+     */
+    public Object getNature(Class natureType);
+    
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java Mon Jun 12 14:44:52 2006
@@ -28,10 +28,10 @@
     /**
      * Returns the module which created the contribution. 
      */
-    public Module getContributingModule();
+    public String getContributingModuleId();
 
     /**
      * Creates a new core service implementation.
      */
-    public Object constructCoreServiceImplementation();
+    public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule);
 }

Added: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java?rev=413747&view=auto
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java (added)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java Mon Jun 12 14:44:52 2006
@@ -0,0 +1,35 @@
+// Copyright 2004, 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.hivemind.internal;
+
+import org.apache.hivemind.InterceptorStack;
+import org.apache.hivemind.Locatable;
+
+/**
+ */
+public interface ServiceInterceptorConstructor extends Locatable
+{
+    /**
+     * @return Returns the name of the interceptor.
+     */
+    public String getName();
+    
+    public String getContributingModuleId();
+    
+    /**
+     * Creates a new core service implementation.
+     */
+    public void constructServiceInterceptor(InterceptorStack interceptorStack, Module contributingModule);
+}

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServicePoint.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServicePoint.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServicePoint.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServicePoint.java Mon Jun 12 14:44:52 2006
@@ -14,9 +14,6 @@
 
 package org.apache.hivemind.internal;
 
-import org.apache.hivemind.Occurances;
-import org.apache.hivemind.schema.Schema;
-
 /**
  * Sub-interface of {@link org.apache.hivemind.internal.ExtensionPoint} that defines a service
  * extension point. A service may have a single factory contribution, and any number of interceptor
@@ -71,19 +68,6 @@
      *             if there is any problem creating the service.
      */
     public Object getService(Class interfaceClass);
-
-    /**
-     * Returns the {@link Schema} used to process any parameters passed to the service. Service
-     * implementation factories and service interceptor factories allow parameters.
-     */
-
-    public Schema getParametersSchema();
-
-    /**
-     * Returns the number of parameter object expected; generally this is the default of exactly one (
-     * {@link Occurances#REQUIRED}).
-     */
-    public Occurances getParametersCount();
 
     /**
      * Forces the service to be fully instantiated immediately, rather than lazily.

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/servlet/HiveMindFilter.java Mon Jun 12 14:44:52 2006
@@ -29,11 +29,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hivemind.ClassResolver;
-import org.apache.hivemind.ModuleDescriptorProvider;
 import org.apache.hivemind.Registry;
 import org.apache.hivemind.impl.DefaultClassResolver;
 import org.apache.hivemind.impl.RegistryBuilder;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
+import org.apache.hivemind.impl.XmlModuleReader;
 import org.apache.hivemind.util.ContextResource;
 
 /**
@@ -105,7 +104,7 @@
 
         ClassResolver resolver = new DefaultClassResolver();
 
-        builder.addModuleDescriptorProvider(getModuleDescriptorProvider(resolver));
+        addDefaultModules(builder, resolver);
 
         addWebInfDescriptor(config.getServletContext(), resolver, builder);
 
@@ -126,9 +125,9 @@
 
         if (r.getResourceURL() != null)
         {
-            ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver, r);
-
-            builder.addModuleDescriptorProvider(provider);
+            XmlModuleReader reader = new XmlModuleReader(builder.getRegistryDefinition(),
+                    resolver, builder.getErrorHandler());
+            reader.readModule(r);
         }
     }
 
@@ -141,16 +140,9 @@
         return Locale.getDefault();
     }
 
-    /**
-     * Returns the {@link ModuleDescriptorProvider} to be used to construct the Registry. This
-     * implementation returns the default {@link XmlModuleDescriptorProvider}. May be overridden by
-     * subclasses.
-     * 
-     * @since 1.1
-     */
-    protected ModuleDescriptorProvider getModuleDescriptorProvider(ClassResolver resolver)
+    protected void addDefaultModules(RegistryBuilder builder, ClassResolver resolver)
     {
-        return new XmlModuleDescriptorProvider(resolver);
+        builder.autoDetectModules();
     }
 
     /**

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java Mon Jun 12 14:44:52 2006
@@ -26,13 +26,13 @@
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.ClassResolver;
 import org.apache.hivemind.Location;
-import org.apache.hivemind.ModuleDescriptorProvider;
 import org.apache.hivemind.Registry;
 import org.apache.hivemind.Resource;
+import org.apache.hivemind.definition.ModuleDefinition;
 import org.apache.hivemind.impl.DefaultClassResolver;
 import org.apache.hivemind.impl.LocationImpl;
 import org.apache.hivemind.impl.RegistryBuilder;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
+import org.apache.hivemind.impl.XmlModuleReader;
 import org.apache.hivemind.internal.ser.ServiceSerializationHelper;
 import org.apache.hivemind.util.ClasspathResource;
 import org.apache.hivemind.util.PropertyUtils;
@@ -417,34 +417,37 @@
     protected Registry buildFrameworkRegistry(String[] files) throws Exception
     {
         ClassResolver resolver = getClassResolver();
+        
+        RegistryBuilder builder = new RegistryBuilder();
+        builder.autoDetectModules();
 
-        List descriptorResources = new ArrayList();
         for (int i = 0; i < files.length; i++)
         {
             Resource resource = getResource(files[i]);
 
-            descriptorResources.add(resource);
+            XmlModuleReader reader = new XmlModuleReader(builder.getRegistryDefinition(),
+                    resolver, builder.getErrorHandler());
+            reader.readModule(resource);
         }
 
-        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver,
-                descriptorResources);
-
-        return buildFrameworkRegistry(provider);
+        return builder.constructRegistry(Locale.getDefault());
     }
 
     /**
-     * Builds a registry, containing only the modules delivered by the specified
-     * {@link org.apache.hivemind.ModuleDescriptorProvider}, plus the master module descriptor
+     * Builds a registry, containing only the modules delivered the parameter
+     * <code>customModules</code>, plus the master module descriptor
      * (i.e., those visible on the classpath).
      */
-    protected Registry buildFrameworkRegistry(ModuleDescriptorProvider customProvider)
+    protected Registry buildFrameworkRegistry(ModuleDefinition[] customModules)
     {
-        ClassResolver resolver = getClassResolver();
-
         RegistryBuilder builder = new RegistryBuilder();
+        builder.autoDetectModules();
 
-        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));
-        builder.addModuleDescriptorProvider(customProvider);
+        for (int i = 0; i < customModules.length; i++)
+        {
+            ModuleDefinition module = customModules[i];
+            builder.getRegistryDefinition().addModule(module);
+        }
 
         return builder.constructRegistry(Locale.getDefault());
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java Mon Jun 12 14:44:52 2006
@@ -15,15 +15,19 @@
 package hivemind.test;
 
 import java.net.URL;
+import java.util.ArrayList;
 
 import org.apache.hivemind.ClassResolver;
+import org.apache.hivemind.Occurances;
 import org.apache.hivemind.Resource;
+import org.apache.hivemind.definition.ConfigurationPointDefinition;
+import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.impl.DefaultClassResolver;
 import org.apache.hivemind.impl.DefaultErrorHandler;
-import org.apache.hivemind.parse.ConfigurationPointDescriptor;
+import org.apache.hivemind.internal.Visibility;
 import org.apache.hivemind.parse.DependencyDescriptor;
 import org.apache.hivemind.parse.ModuleDescriptor;
-import org.apache.hivemind.parse.ServicePointDescriptor;
 import org.apache.hivemind.parse.XmlResourceProcessor;
 import org.apache.hivemind.test.HiveMindTestCase;
 
@@ -71,15 +75,12 @@
 
     /**
      * Convenience method for creating a
-     * {@link org.apache.hivemind.parse.ModuleDescriptor}.
+     * {@link ModuleDefinition}.
      */
-    protected ModuleDescriptor createModuleDescriptor(String moduleId, String version)
+    protected ModuleDefinition createModuleDefinition(String moduleId, String version)
     {
-        ModuleDescriptor result = new ModuleDescriptor(_resolver, new DefaultErrorHandler());
-
-        result.setModuleId(moduleId);
-        result.setVersion(version);
-        result.setLocation(newLocation());
+        ModuleDefinition result = new ModuleDefinition(moduleId, newLocation(), 
+                getClassResolver(), "");
 
         return result;
     }
@@ -100,15 +101,12 @@
     }
 
     /**
-     * Convenience method for creating a {@link ServicePointDescriptor}.
+     * Convenience method for creating a {@link ServicePointDefinition}.
      */
-    protected ServicePointDescriptor createServicePointDescriptor(String pointId, Class serviceInterface)
+    protected ServicePointDefinition createServicePointDefinition(String pointId, Class serviceInterface)
     {
-        ServicePointDescriptor result = new ServicePointDescriptor();
-
-        result.setId(pointId);
-        result.setInterfaceClassName(serviceInterface.getName());
-        result.setLocation(newLocation());
+        ServicePointDefinition result = new ServicePointDefinition(pointId,
+                newLocation(), Visibility.PUBLIC, serviceInterface.getClass().getName());
 
         return result;
     }
@@ -116,12 +114,11 @@
     /**
      * Convenience method for creating a {@link ConfigurationPointDescriptor}.
      */
-    protected ConfigurationPointDescriptor createConfigurationPointDescriptor(String pointId)
+    protected ConfigurationPointDefinition createConfigurationPointDefinition(String pointId)
     {
-        ConfigurationPointDescriptor result = new ConfigurationPointDescriptor();
-
-        result.setId(pointId);
-        result.setLocation(newLocation());
+        ConfigurationPointDefinition result = new ConfigurationPointDefinition(pointId,
+                newLocation(), Visibility.PUBLIC, null, ArrayList.class.getName(),
+                Occurances.UNBOUNDED);
 
         return result;
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestRegistryBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestRegistryBuilder.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestRegistryBuilder.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestRegistryBuilder.java Mon Jun 12 14:44:52 2006
@@ -24,10 +24,10 @@
 
 import org.apache.hivemind.ClassResolver;
 import org.apache.hivemind.Registry;
+import org.apache.hivemind.definition.ModuleDefinition;
 import org.apache.hivemind.impl.DefaultClassResolver;
 import org.apache.hivemind.impl.RegistryBuilder;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
-import org.apache.hivemind.parse.ModuleDescriptor;
+import org.apache.hivemind.impl.XmlRegistryProvider;
 import org.apache.hivemind.service.ClassFactory;
 
 /**
@@ -59,11 +59,12 @@
 
         RegistryBuilder b = new RegistryBuilder();
 
-        b.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));
-
+        XmlRegistryProvider provider = new XmlRegistryProvider(resolver, XmlRegistryProvider.HIVE_MODULE_XML);
+        provider.process(b.getRegistryDefinition(), b.getErrorHandler());
+        
         Registry r = b.constructRegistry(Locale.getDefault());
 
-        List l = r.getConfiguration("hivemind.test.config.Symbols");
+        List l = (List) r.getConfiguration("hivemind.test.config.Symbols");
         assertEquals(1, l.size());
 
         Datum d = (Datum) l.get(0);
@@ -87,36 +88,29 @@
     {
         String duplicateModuleId = "non.unique.module";
 
-        ModuleDescriptor firstModule = createModuleDescriptor(duplicateModuleId, null);
-        ModuleDescriptor duplicateModule = createModuleDescriptor(duplicateModuleId, null);
-
-        SimpleModuleDescriptorProvider provider = new SimpleModuleDescriptorProvider();
-        provider.addModuleDescriptor(firstModule);
-        provider.addModuleDescriptor(duplicateModule);
+        ModuleDefinition firstModule = createModuleDefinition(duplicateModuleId, null);
+        ModuleDefinition duplicateModule = createModuleDefinition(duplicateModuleId, null);
 
         interceptLogging();
 
-        buildFrameworkRegistry(provider);
+        buildFrameworkRegistry(new ModuleDefinition[] {firstModule, duplicateModule});
 
         assertLoggedMessagePattern("Module " + duplicateModuleId + " is duplicated!");
     }
 
     public void testDuplicateExtensionPoints() throws Exception
     {
-        ModuleDescriptor testModule = createModuleDescriptor("hivemind.test", null);
-
-        testModule.addServicePoint(createServicePointDescriptor("MyService", Comparable.class));
-        testModule.addServicePoint(createServicePointDescriptor("MyService", Comparable.class));
+        ModuleDefinition testModule = createModuleDefinition("hivemind.test", null);
 
-        testModule.addConfigurationPoint(createConfigurationPointDescriptor("MyConfig"));
-        testModule.addConfigurationPoint(createConfigurationPointDescriptor("MyConfig"));
+        testModule.addServicePoint(createServicePointDefinition("MyService", Comparable.class));
+        testModule.addServicePoint(createServicePointDefinition("MyService", Comparable.class));
 
-        SimpleModuleDescriptorProvider provider = new SimpleModuleDescriptorProvider();
-        provider.addModuleDescriptor(testModule);
+        testModule.addConfigurationPoint(createConfigurationPointDefinition("MyConfig"));
+        testModule.addConfigurationPoint(createConfigurationPointDefinition("MyConfig"));
 
         interceptLogging();
 
-        buildFrameworkRegistry(provider);
+        buildFrameworkRegistry(new ModuleDefinition[] {testModule});
 
         List interceptedEvents = getInterceptedLogEvents();
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConfigurationPoint.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConfigurationPoint.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConfigurationPoint.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConfigurationPoint.java Mon Jun 12 14:44:52 2006
@@ -32,7 +32,6 @@
 import org.apache.hivemind.Registry;
 import org.apache.hivemind.Resource;
 import org.apache.hivemind.impl.RegistryBuilder;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
 import org.apache.hivemind.util.ClasspathResource;
 
 /**
@@ -47,7 +46,7 @@
     {
         Registry r = buildFrameworkRegistry("Empty.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Empty");
+        List l = (List) r.getConfiguration("hivemind.test.config.Empty");
 
         assertEquals(0, l.size());
     }
@@ -56,7 +55,7 @@
     {
         Registry r = buildFrameworkRegistry("Simple.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Simple");
+        List l = (List) r.getConfiguration("hivemind.test.config.Simple");
 
         assertEquals(2, l.size());
 
@@ -76,7 +75,7 @@
     {
         Registry r = buildFrameworkRegistry("Null.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Null");
+        List l = (List) r.getConfiguration("hivemind.test.config.Null");
 
         assertEquals(1, l.size());
 
@@ -87,7 +86,7 @@
     {
         Registry r = buildFrameworkRegistry("AttributeDefaults.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.AttributeDefaults");
+        List l = (List) r.getConfiguration("hivemind.test.config.AttributeDefaults");
 
         assertEquals(1, l.size());
         Datum d = (Datum) l.get(0);
@@ -100,7 +99,7 @@
     {
         Registry r = buildFrameworkRegistry("Nested.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Nested");
+        List l = (List) r.getConfiguration("hivemind.test.config.Nested");
 
         assertEquals(1, l.size());
 
@@ -118,7 +117,7 @@
     {
         Registry r = buildFrameworkRegistry("Structured.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Structured");
+        List l = (List) r.getConfiguration("hivemind.test.config.Structured");
 
         assertEquals(2, l.size());
 
@@ -138,7 +137,7 @@
     {
         Registry r = buildFrameworkRegistry("SetParent.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.SetParent");
+        List l = (List) r.getConfiguration("hivemind.test.config.SetParent");
 
         assertEquals(1, l.size());
 
@@ -171,7 +170,7 @@
 
         Registry r = buildFrameworkRegistry("BooleanTranslator.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.BooleanTranslator");
+        List l = (List) r.getConfiguration("hivemind.test.config.BooleanTranslator");
 
         // Trigger the proxy
 
@@ -199,7 +198,7 @@
 
         Registry r = buildFrameworkRegistry("IntTranslator.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.IntTranslator");
+        List l = (List) r.getConfiguration("hivemind.test.config.IntTranslator");
 
         // Convert the proxy into a real list.
 
@@ -239,7 +238,7 @@
     {
         Registry r = buildFrameworkRegistry("InstanceTranslator.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.InstanceTranslator");
+        List l = (List) r.getConfiguration("hivemind.test.config.InstanceTranslator");
 
         assertEquals(1, l.size());
 
@@ -257,7 +256,7 @@
 
         Registry r = buildFrameworkRegistry("Symbols.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Symbols");
+        List l = (List) r.getConfiguration("hivemind.test.config.Symbols");
 
         assertEquals(3, l.size());
 
@@ -283,7 +282,7 @@
     {
         Registry r = buildFrameworkRegistry("NoSchema.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.NoSchema");
+        List l = (List) r.getConfiguration("hivemind.test.config.NoSchema");
 
         assertEquals(2, l.size());
 
@@ -305,7 +304,7 @@
     {
         Registry r = buildFrameworkRegistry("Localized.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Localized");
+        List l = (List) r.getConfiguration("hivemind.test.config.Localized");
         assertEquals(1, l.size());
 
         Datum d = (Datum) l.get(0);
@@ -318,7 +317,7 @@
     {
         Registry r = buildFrameworkRegistry("Simple.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Simple");
+        List l = (List) r.getConfiguration("hivemind.test.config.Simple");
 
         assertEquals("<Element List Proxy for hivemind.test.config.Simple>", l.toString());
 
@@ -327,7 +326,7 @@
 
         assertEquals(2, l.size());
 
-        List l2 = r.getConfiguration("hivemind.test.config.Simple");
+        List l2 = (List) r.getConfiguration("hivemind.test.config.Simple");
 
         assertNotSame(l, l2);
         assertEquals(l, l2);
@@ -363,7 +362,7 @@
     {
         Registry r = buildFrameworkRegistry("BadAttributes.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.BadAttributes");
+        List l = (List) r.getConfiguration("hivemind.test.config.BadAttributes");
 
         try
         {
@@ -387,7 +386,7 @@
 
         interceptLogging("hivemind.test.config");
 
-        List l = r.getConfiguration("hivemind.test.config.BadElement");
+        List l = (List) r.getConfiguration("hivemind.test.config.BadElement");
 
         assertEquals(1, l.size());
 
@@ -398,7 +397,7 @@
     {
         Registry r = buildFrameworkRegistry("CustomRule.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.CustomRule");
+        List l = (List) r.getConfiguration("hivemind.test.config.CustomRule");
 
         Datum d = (Datum) l.get(0);
 
@@ -439,7 +438,7 @@
 
         Registry r = builder.constructRegistry(Locale.FRENCH);
 
-        List l = r.getConfiguration("hivemind.test.config.ResourceTranslator");
+        List l = (List) r.getConfiguration("hivemind.test.config.ResourceTranslator");
 
         interceptLogging();
 
@@ -467,7 +466,7 @@
     {
         Registry r = buildFrameworkRegistry("Simple.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Simple");
+        List l = (List) r.getConfiguration("hivemind.test.config.Simple");
 
         assertEquals(2, l.size());
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConversion.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConversion.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConversion.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConversion.java Mon Jun 12 14:44:52 2006
@@ -35,7 +35,7 @@
     {
         Registry r = buildFrameworkRegistry("Basics.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Basics");
+        List l = (List) r.getConfiguration("hivemind.test.config.Basics");
 
         assertEquals(1, l.size());
 
@@ -56,7 +56,7 @@
     {
         Registry r = buildFrameworkRegistry("ConversionParentMethod.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.ConversionParentMethod");
+        List l = (List) r.getConfiguration("hivemind.test.config.ConversionParentMethod");
 
         assertEquals(1, l.size());
 
@@ -77,7 +77,7 @@
     {
         Registry r = buildFrameworkRegistry("Basics2.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.Basics2");
+        List l = (List) r.getConfiguration("hivemind.test.config.Basics2");
 
         assertEquals(1, l.size());
 
@@ -98,7 +98,7 @@
     {
         Registry r = buildFrameworkRegistry("ComplexAttributeName.xml");
 
-        List l = r.getConfiguration("hivemind.test.config.ComplexAttributeName");
+        List l = (List) r.getConfiguration("hivemind.test.config.ComplexAttributeName");
 
         assertEquals(1, l.size());
 
@@ -117,7 +117,7 @@
             "Mappings for unknown attribute\\(s\\) \\[extra\\] "
                 + "\\(for element data-item\\) have been ignored\\.");
 
-        List l = r.getConfiguration("hivemind.test.config.ExtraAttributeNames");
+        List l = (List) r.getConfiguration("hivemind.test.config.ExtraAttributeNames");
 
         assertEquals(1, l.size());
 
@@ -144,7 +144,7 @@
             "Mapping for attribute item-name conflicts with a previous "
                 + "mapping \\(at .*\\) and has been ignored\\.");
 
-        List l = r.getConfiguration("hivemind.test.config.DuplicateAttribute");
+        List l = (List) r.getConfiguration("hivemind.test.config.DuplicateAttribute");
 
         assertEquals(1, l.size());
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestUniqueElementAttribute.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestUniqueElementAttribute.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestUniqueElementAttribute.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestUniqueElementAttribute.java Mon Jun 12 14:44:52 2006
@@ -33,7 +33,7 @@
             buildFrameworkRegistry(
                 new String[] { "UniqueAttributeDefinition.xml", "UniqueAttributeBroken.xml" });
 
-        List elements = r.getConfiguration("hivemind.test.parse.MyExtensionPoint");
+        List elements = (List) r.getConfiguration("hivemind.test.parse.MyExtensionPoint");
 
         try
         {
@@ -60,7 +60,7 @@
             buildFrameworkRegistry(
                 new String[] { "UniqueAttributeDefinition.xml", "UniqueAttributeBroken.xml" });
 
-        List elements = r.getConfiguration("hivemind.test.parse.MyExtensionPoint2");
+        List elements = (List) r.getConfiguration("hivemind.test.parse.MyExtensionPoint2");
 
         assertEquals(3, elements.size());
     }
@@ -74,7 +74,7 @@
             buildFrameworkRegistry(
                 new String[] { "UniqueAttributeDefinition.xml", "UniqueAttributeBroken.xml" });
 
-        List elements = r.getConfiguration("hivemind.test.parse.MyExtensionPoint3");
+        List elements = (List) r.getConfiguration("hivemind.test.parse.MyExtensionPoint3");
 
         assertEquals(3, elements.size());
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestModuleDescriptor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestModuleDescriptor.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestModuleDescriptor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestModuleDescriptor.java Mon Jun 12 14:44:52 2006
@@ -39,11 +39,11 @@
         Location l1 = new LocationImpl(r, 20);
         Location l2 = new LocationImpl(r, 97);
 
-        SchemaImpl s1 = new SchemaImpl();
+        SchemaImpl s1 = new SchemaImpl("test");
         s1.setId("bar");
         s1.setLocation(l1);
 
-        SchemaImpl s2 = new SchemaImpl();
+        SchemaImpl s2 = new SchemaImpl("test");
         s2.setId("bar");
         s2.setLocation(l2);
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestToString.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestToString.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestToString.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/TestToString.java Mon Jun 12 14:44:52 2006
@@ -68,7 +68,6 @@
         new InterceptorDescriptor().toString();
         new ModuleImpl().toString();
         new RegistryInfrastructureImpl(null, Locale.ENGLISH).toString();
-        new ContributionImpl().toString();
         new ConfigurationPointImpl().toString();
         new ElementImpl().toString();
         new AttributeImpl("foo", "bar").toString();

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConfigurationTranslator.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConfigurationTranslator.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConfigurationTranslator.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConfigurationTranslator.java Mon Jun 12 14:44:52 2006
@@ -52,7 +52,7 @@
                 "hivemind.test.rules.ExtensionPointTranslator",
                 DatumHolder.class);
         List l1 = h.getDatums();
-        List l2 = r.getConfiguration("hivemind.test.rules.EP");
+        List l2 = (List) r.getConfiguration("hivemind.test.rules.EP");
 
         assertSame(l2, l1);
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInstanceTranslator.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInstanceTranslator.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInstanceTranslator.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInstanceTranslator.java Mon Jun 12 14:44:52 2006
@@ -127,7 +127,7 @@
 
         interceptLogging();
 
-        List l = r.getConfiguration("hivemind.test.rules.WrongType");
+        List l = (List) r.getConfiguration("hivemind.test.rules.WrongType");
 
         // Convert the proxy into a real list; this will trigger the
         // expected errors.

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInvokeParentRule.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInvokeParentRule.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInvokeParentRule.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInvokeParentRule.java Mon Jun 12 14:44:52 2006
@@ -33,7 +33,7 @@
 
         try
         {
-            List l = r.getConfiguration("hivemind.test.rules.InvokeFailure");
+            List l = (List) r.getConfiguration("hivemind.test.rules.InvokeFailure");
 
             l.size();
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetPropertyRule.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetPropertyRule.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetPropertyRule.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetPropertyRule.java Mon Jun 12 14:44:52 2006
@@ -30,7 +30,7 @@
     {
         Registry r = buildFrameworkRegistry("SetPropertyRule.xml");
 
-        List l = r.getConfiguration("hivemind.test.rules.HonorRoll");
+        List l = (List) r.getConfiguration("hivemind.test.rules.HonorRoll");
 
         assertEquals(2, l.size());
         TruthTeller t = (TruthTeller) l.get(0);

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/ConstructorFactory.xml
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/ConstructorFactory.xml?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/ConstructorFactory.xml (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/ConstructorFactory.xml Mon Jun 12 14:44:52 2006
@@ -66,7 +66,7 @@
   	<invoke-factory>
   		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
   			<configuration>DummyConfiguration</configuration>
-  			<set property="expectedConstructorMessage" value="(List)"/>
+  			<set property="expectedConstructorMessage" value="(Map)"/>
   		</construct>
   	</invoke-factory>	
   </service-point>
@@ -101,9 +101,9 @@
   	</invoke-factory>	
   </service-point>
 
-  <configuration-point id="DummyConfiguration">
-	<schema>
-		<element name="element" key-attribute="key">
+  <configuration-point id="DummyConfiguration" container-class="java.util.Map">
+	<schema root-element-class="java.util.HashMap">
+		<element name="element" >
 			<attribute name="key"/>
 		</element>
 	</schema>

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java Mon Jun 12 14:44:52 2006
@@ -14,16 +14,15 @@
 
 package hivemind.test.services.impl;
 
-import java.util.List;
-import java.util.Map;
+import hivemind.test.services.ConstructorAccess;
 
-import org.apache.commons.logging.Log;
-import org.apache.hivemind.Messages;
+import java.util.Map;
 
 import junit.framework.Assert;
 import junit.framework.AssertionFailedError;
 
-import hivemind.test.services.ConstructorAccess;
+import org.apache.commons.logging.Log;
+import org.apache.hivemind.Messages;
 
 /**
  * Used to test constructor parameter passing of
@@ -61,9 +60,9 @@
         actualMessage = "(ConstructorAccess, String)";
     }
 
-    public ConstructorAccessImpl(List configurations)
+    public ConstructorAccessImpl(Map configurations)
     {
-        actualMessage = "(List)";
+        actualMessage = "(Map)";
     }
 
     public ConstructorAccessImpl(Map configurations, long l)

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestTranslatorManager.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestTranslatorManager.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestTranslatorManager.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestTranslatorManager.java Mon Jun 12 14:44:52 2006
@@ -24,7 +24,7 @@
 import org.easymock.MockControl;
 
 /**
- * Tests for {@link org.apache.hivemind.impl.TranslatorManager}.
+ * Tests for {@link org.apache.hivemind.impl.TranslatorManagerImpl}.
  * 
  * @author Howard Lewis Ship
  */
@@ -37,7 +37,7 @@
         MockControl c = newControl(RegistryInfrastructure.class);
         RegistryInfrastructure result = (RegistryInfrastructure) c.getMock();
 
-        result.getConfiguration(TranslatorManager.TRANSLATORS_CONFIGURATION_ID, null);
+        result.getConfiguration(TranslatorManagerImpl.TRANSLATORS_CONFIGURATION_ID, null);
         c.setReturnValue(l);
 
         return result;
@@ -54,14 +54,14 @@
 
         eh
                 .error(
-                        TranslatorManager.LOG,
+                        TranslatorManagerImpl.LOG,
                         "Translator contribution 'invalid' must specify either the service-id or class attribute.",
                         null,
                         null);
 
         replayControls();
 
-        TranslatorManager tm = new TranslatorManager(r, eh);
+        TranslatorManagerImpl tm = new TranslatorManagerImpl(r, eh);
 
         try
         {

Modified: jakarta/hivemind/branches/branch-2-0-annot/jmx/src/test/org/apache/hivemind/management/TestMBeanRegistry.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/jmx/src/test/org/apache/hivemind/management/TestMBeanRegistry.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/jmx/src/test/org/apache/hivemind/management/TestMBeanRegistry.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/jmx/src/test/org/apache/hivemind/management/TestMBeanRegistry.java Mon Jun 12 14:44:52 2006
@@ -72,7 +72,7 @@
     public void testContribution() throws Exception
     {
         Registry registry = buildFrameworkRegistry("testMBeanRegistry.xml");
-        List mBeanList = registry.getConfiguration("hivemind.management.MBeans");
+        List mBeanList = (List) registry.getConfiguration("hivemind.management.MBeans");
 
         // Training
         ServicePoint sp1 = ((MBeanRegistrationContribution) mBeanList.get(0)).getServicePoint();
@@ -153,7 +153,7 @@
     public void testRegistrationException() throws Exception
     {
         Registry registry = buildFrameworkRegistry("testMBeanRegistry.xml");
-        List mBeanList = registry.getConfiguration("hivemind.management.MBeans");
+        List mBeanList = (List) registry.getConfiguration("hivemind.management.MBeans");
 
         ServicePoint sp1 = ((MBeanRegistrationContribution) mBeanList.get(0)).getServicePoint();
         ObjectName on1 = objectNameBuilder.createServiceObjectName(sp1);

Propchange: jakarta/hivemind/branches/branch-2-0-annot/xml/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 12 14:44:52 2006
@@ -0,0 +1,2 @@
+
+target

Added: jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/MANIFEST.MF?rev=413747&view=auto
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/MANIFEST.MF (added)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/MANIFEST.MF Mon Jun 12 14:44:52 2006
@@ -0,0 +1,5 @@
+hivemind-provider: org.apache.hivemind.impl.XmlRegistryProvider
+
+
+Name: hivemind
+hivemind-provider: org.apache.hivemind.impl.XmlRegistryProvider
\ No newline at end of file

Modified: jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml?rev=413747&r1=413141&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml Mon Jun 12 14:44:52 2006
@@ -634,17 +634,18 @@
     <startup object="service:EagerLoad"/>
   </contribution>
   
-  <configuration-point id="ObjectProviders">
+  <configuration-point id="ObjectProviders" container-class="java.util.Map">
     
     Services that can provide objects for the object translator.
       
-    <schema>
-      <element name="provider" key-attribute="prefix">
+    <schema root-element-class="java.util.HashMap">
+      <element name="provider" >
         <attribute name="prefix">The prefix used to identify the provider.</attribute>
         <attribute name="service-id" required="true" translator="service">The object providing service.</attribute>
         <rules>
+         <push-attribute attribute="prefix"/>
          <push-attribute attribute="service-id"/>
-         <invoke-parent method="addElement"/>
+         <invoke-parent method="put" parameter-count="2"/>
         </rules>
       </element>
     </schema>

Added: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/TranslatorManager.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/TranslatorManager.java?rev=413747&view=auto
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/TranslatorManager.java (added)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/TranslatorManager.java Mon Jun 12 14:44:52 2006
@@ -0,0 +1,10 @@
+package org.apache.hivemind;
+
+import org.apache.hivemind.schema.Translator;
+
+public interface TranslatorManager
+{
+
+    public abstract Translator getTranslator(String constructor);
+
+}
\ No newline at end of file

Modified: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/ConstructRegistry.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/ConstructRegistry.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/ConstructRegistry.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/ConstructRegistry.java Mon Jun 12 14:44:52 2006
@@ -26,7 +26,6 @@
 import org.apache.hivemind.ModuleDescriptorProvider;
 import org.apache.hivemind.Resource;
 import org.apache.hivemind.impl.DefaultClassResolver;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
 import org.apache.hivemind.util.FileResource;
 import org.apache.hivemind.util.URLResource;
 import org.apache.tools.ant.BuildException;
@@ -111,8 +110,9 @@
         {
             enqueue(moduleDescriptors);
 
-            ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(
-                    new DefaultClassResolver(), _resourceQueue);
+            ModuleDescriptorProvider provider = null;
+//                new XmlModuleDescriptorProvider( 
+//                    new DefaultClassResolver(), _resourceQueue);
 
             RegistrySerializer generator = new RegistrySerializer();
 
@@ -170,7 +170,7 @@
 
         Resource jarResource = new URLResource(jarRootURL);
 
-        enqueueIfExists(jarResource, XmlModuleDescriptorProvider.HIVE_MODULE_XML);
+//        enqueueIfExists(jarResource, XmlModuleDescriptorProvider.HIVE_MODULE_XML);
     }
 
     private void enqueueIfExists(Resource jarResource, String path)

Modified: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java?rev=413747&r1=413746&r2=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java Mon Jun 12 14:44:52 2006
@@ -33,7 +33,6 @@
 import org.apache.hivemind.Occurances;
 import org.apache.hivemind.impl.DefaultClassResolver;
 import org.apache.hivemind.impl.DefaultErrorHandler;
-import org.apache.hivemind.impl.XmlModuleDescriptorProvider;
 import org.apache.hivemind.internal.Visibility;
 import org.apache.hivemind.parse.AttributeMappingDescriptor;
 import org.apache.hivemind.parse.ConfigurationPointDescriptor;
@@ -736,11 +735,11 @@
     public static Document createDefaultRegistryDocument()
     {
         ClassResolver resolver = new DefaultClassResolver();
-        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver);
+//        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver);
 
         RegistrySerializer serializer = new RegistrySerializer();
 
-        serializer.addModuleDescriptorProvider(provider);
+//        serializer.addModuleDescriptorProvider(provider);
 
         return serializer.createRegistryDocument();
     }

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ContributionImpl.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ContributionImpl.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ContributionImpl.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java Mon Jun 12 14:44:52 2006
@@ -18,8 +18,12 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.impl.natures.XmlConfigurationPointNature;
+import org.apache.hivemind.internal.ConfigurationPoint;
 import org.apache.hivemind.internal.Contribution;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.schema.Schema;
 
 /**
  * Implements the {@link org.apache.hivemind.internal.Contribution} interface, a wrapper
@@ -29,18 +33,19 @@
  */
 public final class ContributionImpl implements Contribution
 {
-    private Module _contributingModule;
+    private String _contributingModuleId;
 
     private List _elements;
-
-    public Module getContributingModule()
+    
+    public ContributionImpl(String moduleId, List elements)
     {
-        return _contributingModule;
+        _contributingModuleId = moduleId;
+        _elements = elements;
     }
 
-    public void setContributingModule(Module module)
+    public String getContributingModuleId()
     {
-        _contributingModule = module;
+        return _contributingModuleId;
     }
 
     public void addElements(List elements)
@@ -58,4 +63,32 @@
 
         return _elements;
     }
+
+    public void contribute(ConfigurationPoint configurationPoint, Object container)
+    {
+        // Retrieve xml nature
+        XmlConfigurationPointNature xmlNature = (XmlConfigurationPointNature) configurationPoint.getNature(XmlConfigurationPointNature.class);
+        if (xmlNature == null) {
+            // TODO:
+            throw new ApplicationRuntimeException("ConfigurationPoint has no xml nature");
+        }
+        
+        Schema contributionsSchema = xmlNature.getSchema();
+
+        Module contributingModule = configurationPoint.getModule().getModule(_contributingModuleId);
+        SchemaProcessorImpl processor = new SchemaProcessorImpl(configurationPoint.getErrorLog(), contributionsSchema);
+        processor.process(container, getElements(), contributingModule);
+
+        // After constructing the result, if the result
+        // will be cached, then there's no need to keep
+        // the schema and extensions (used to build the
+        // result); it can all be released to the GC.
+        
+        // TODO schema can not be deleted here since there are still other contributions
+        // that need the schema
+        // configurationPoint.putMetaData("schema", null);
+
+        
+    }
+
 }

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java Mon Jun 12 14:44:52 2006
@@ -16,6 +16,7 @@
 
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
+import org.apache.hivemind.internal.ServicePoint;
 import org.apache.hivemind.util.InstanceCreationUtils;
 
 /**
@@ -26,21 +27,21 @@
 public final class CreateClassServiceConstructor extends BaseLocatable implements
         ServiceImplementationConstructor
 {
-    private Module _contributingModule;
+    private String _contributingModuleId;
 
     private String _instanceClassName;
 
-    public Object constructCoreServiceImplementation()
+    public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
     {
         return InstanceCreationUtils.createInstance(
-                _contributingModule,
+                contributingModule,
                 _instanceClassName,
                 getLocation());
     }
 
-    public Module getContributingModule()
+    public String getContributingModuleId()
     {
-        return _contributingModule;
+        return _contributingModuleId;
     }
 
     public String getInstanceClassName()
@@ -48,9 +49,9 @@
         return _instanceClassName;
     }
 
-    public void setContributingModule(Module module)
+    public void setContributingModuleId(String moduleId)
     {
-        _contributingModule = module;
+        _contributingModuleId = moduleId;
     }
 
     public void setInstanceClassName(String string)

Added: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java?rev=413747&view=auto
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java (added)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java Mon Jun 12 14:44:52 2006
@@ -0,0 +1,115 @@
+// Copyright 2004, 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.hivemind.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.InterceptorStack;
+import org.apache.hivemind.ServiceInterceptorFactory;
+import org.apache.hivemind.impl.natures.XmlServicePointNature;
+import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.ServiceInterceptorConstructor;
+import org.apache.hivemind.internal.ServicePoint;
+import org.apache.hivemind.schema.Schema;
+
+/**
+ * Constructs a new interceptor by invoking methods on another service (which implements the
+ * {@link org.apache.hivemind.ServiceInterceptorFactory} interface.
+ */
+public final class InvokeFactoryInterceptorConstructor extends BaseLocatable implements
+        ServiceInterceptorConstructor
+{
+    private String _factoryServiceId;
+    
+    private ServiceInterceptorFactory _factory;
+
+    private String _contributingModuleId;
+
+    /** List of {@link org.apache.hivemind.Element}, the raw XML parameters. */
+    private List _parameters;
+
+    /** The parameters converted to objects as per the factory's parameter schema. */
+    private List _convertedParameters;
+    
+    public String getName()
+    {
+        return _factoryServiceId;
+    }
+
+    public void constructServiceInterceptor(InterceptorStack stack, Module contributingModule)
+    {
+        setup(contributingModule);
+
+        _factory.createInterceptor(stack, contributingModule, _convertedParameters);
+    }
+
+    // A lot of changes to synchronization and service construction occured between 1.1 and 1.1.1;
+    // this method was split off and made synchronized ... otherwise, it was possible for the
+    // pooled or threaded services to get into a potential race condition through this code.
+
+    private synchronized void setup(Module contributingModule)
+    {
+        if (_factory == null)
+        {
+            ServicePoint factoryPoint = contributingModule.getServicePoint(_factoryServiceId);
+
+            _factory = (ServiceInterceptorFactory) factoryPoint
+                    .getService(ServiceInterceptorFactory.class);
+
+            XmlServicePointNature xmlNature = (XmlServicePointNature) factoryPoint.getNature(XmlServicePointNature.class);
+            if (xmlNature == null) {
+                // TODO:
+                throw new ApplicationRuntimeException("ServicePoint has no xml nature");
+            }
+
+            Schema schema = xmlNature.getParametersSchema();
+
+            SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
+                    schema);
+
+            // TODO annotations: implement more generic parameter container
+            _convertedParameters = new ArrayList();
+            processor.process(_convertedParameters, _parameters, contributingModule);
+        }
+    }
+
+    public String getContributingModuleId()
+    {
+        return _contributingModuleId;
+    }
+
+    public void setContributingModuleId(String moduleId)
+    {
+        _contributingModuleId = moduleId;
+    }
+
+    public List getParameters()
+    {
+        return _parameters;
+    }
+
+    public void setParameters(List list)
+    {
+        _parameters = list;
+    }
+
+    public void setFactoryServiceId(String string)
+    {
+        _factoryServiceId = string;
+    }
+
+}
\ No newline at end of file

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java Mon Jun 12 14:44:52 2006
@@ -14,6 +14,7 @@
 
 package org.apache.hivemind.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hivemind.ApplicationRuntimeException;
@@ -21,6 +22,7 @@
 import org.apache.hivemind.Occurances;
 import org.apache.hivemind.ServiceImplementationFactory;
 import org.apache.hivemind.ServiceImplementationFactoryParameters;
+import org.apache.hivemind.impl.natures.XmlServicePointNature;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServicePoint;
@@ -37,9 +39,7 @@
 {
     private String _factoryServiceId;
 
-    private ServicePoint _serviceExtensionPoint;
-
-    private Module _contributingModule;
+    private String _contributingModuleId;
 
     /** List of {@link org.apache.hivemind.Element}, the raw XML parameters. */
     private List _parameters;
@@ -50,14 +50,14 @@
     /** The parameters converted to objects as per the factory's parameter schema. */
     private List _convertedParameters;
 
-    public Object constructCoreServiceImplementation()
+    public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
     {
-        setupFactoryAndParameters();
+        setupFactoryAndParameters(servicePoint, contributingModule);
 
         try
         {
             ServiceImplementationFactoryParameters factoryParameters = new ServiceImplementationFactoryParametersImpl(
-                    _serviceExtensionPoint, _contributingModule, _convertedParameters);
+                    servicePoint, contributingModule, _convertedParameters);
 
             return _factory.createCoreServiceImplementation(factoryParameters);
         }
@@ -71,26 +71,32 @@
     // this method was split off and made synchronized ... otherwise, it was possible for the
     // pooled or threaded services to get into a potential race condition through this code.
 
-    private synchronized void setupFactoryAndParameters()
+    private synchronized void setupFactoryAndParameters(ServicePoint servicePoint, Module contributingModule)
     {
         if (_factory == null)
         {
-            ServicePoint factoryPoint = _contributingModule.getServicePoint(_factoryServiceId);
+            ServicePoint factoryPoint = contributingModule.getServicePoint(_factoryServiceId);
 
-            Occurances expected = factoryPoint.getParametersCount();
+            XmlServicePointNature xmlNature = (XmlServicePointNature) factoryPoint.getNature(XmlServicePointNature.class);
+            if (xmlNature == null) {
+                // TODO:
+                throw new ApplicationRuntimeException("ServicePoint has no xml nature");
+            }
+            
+            Occurances expected = xmlNature.getParametersCount();
 
             _factory = (ServiceImplementationFactory) factoryPoint
                     .getService(ServiceImplementationFactory.class);
 
-            Schema schema = factoryPoint.getParametersSchema();
+            Schema schema = xmlNature.getParametersSchema();
 
-            ErrorLog errorLog = _serviceExtensionPoint.getErrorLog();
+            ErrorLog errorLog = servicePoint.getErrorLog();
 
             SchemaProcessorImpl processor = new SchemaProcessorImpl(errorLog, schema);
 
-            processor.process(_parameters, _contributingModule);
-
-            _convertedParameters = processor.getElements();
+            // TODO: implement more generic parameter container
+            _convertedParameters = new ArrayList();
+            processor.process(_convertedParameters, _parameters, contributingModule);
 
             checkParameterCounts(errorLog, expected);
         }
@@ -111,14 +117,14 @@
         log.error(message, getLocation(), null);
     }
 
-    public Module getContributingModule()
+    public String getContributingModuleId()
     {
-        return _contributingModule;
+        return _contributingModuleId;
     }
 
-    public void setContributingModule(Module module)
+    public void setContributingModuleId(String moduleId)
     {
-        _contributingModule = module;
+        _contributingModuleId = moduleId;
     }
 
     public List getParameters()
@@ -126,11 +132,6 @@
         return _parameters;
     }
 
-    public ServicePoint getServiceExtensionPoint()
-    {
-        return _serviceExtensionPoint;
-    }
-
     public void setParameters(List list)
     {
         _parameters = list;
@@ -139,11 +140,6 @@
     public void setFactoryServiceId(String string)
     {
         _factoryServiceId = string;
-    }
-
-    public void setServiceExtensionPoint(ServicePoint point)
-    {
-        _serviceExtensionPoint = point;
     }
 
 }

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaElement.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaElement.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaElement.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java Mon Jun 12 14:44:52 2006
@@ -57,9 +57,9 @@
      * Keyed on attribute name, value is string (possibly null) used to access a translator.
      */
     private Map _attributeTranslators = new HashMap();
-
+    
     private Map _attributeDefaults = new HashMap();
-
+    
     /**
      * Map of Maps. The outer key is an attribute name string, this indicates that the attribute
      * values should be unique. Inner map is keyed on attribute value (as a string), the value is

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java Mon Jun 12 14:44:52 2006
@@ -21,11 +21,14 @@
 
 import org.apache.hivemind.Element;
 import org.apache.hivemind.ErrorLog;
+import org.apache.hivemind.TranslatorManager;
+import org.apache.hivemind.impl.natures.XmlRegistryNature;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.schema.ElementModel;
 import org.apache.hivemind.schema.Schema;
 import org.apache.hivemind.schema.SchemaProcessor;
 import org.apache.hivemind.schema.Translator;
+import org.apache.hivemind.util.Defense;
 
 /**
  * Used to assemble all the {@link org.apache.hivemind.internal.Contribution}s contributed to an
@@ -40,19 +43,10 @@
 
     private Schema _schema;
 
-    /**
-     * The assembled elements that will be contributed into the ConfigurationPoint.
-     */
-    private List _elements = new ArrayList();
-
-    private boolean _canElementsBeMapped;
-
-    private Map _mappedElements = new HashMap();
-
     private List _stack = new ArrayList();
 
     private Module _contributingModule;
-
+    
     /**
      * Map on element name to {@link SchemaElement}.
      */
@@ -67,7 +61,6 @@
     {
         _errorLog = errorLog;
         _schema = schema;
-        _stack.add(this);
 
         if (_schema != null)
         {
@@ -80,51 +73,9 @@
                 _elementMap.put(model.getElementName(), new SchemaElement(this, model));
             }
 
-            _canElementsBeMapped = schema.canInstancesBeKeyed();
         }
     }
 
-    /**
-     * Invoked over reflection by the {@link org.apache.hivemind.schema.rules.InvokeParentRule}.
-     */
-    public void addElement(Object element)
-    {
-        _elements.add(element);
-
-        if (_canElementsBeMapped)
-        {
-            Element currentElement = peekElement();
-            String keyAttribute = _activeElement.getKeyAttribute();
-
-            String expandedKey = getContributingModule().expandSymbols(
-                    currentElement.getAttributeValue(keyAttribute),
-                    currentElement.getLocation());
-
-            Translator t = getAttributeTranslator(keyAttribute);
-
-            Object finalValue = t.translate(
-                    getContributingModule(),
-                    Object.class,
-                    expandedKey,
-                    currentElement.getLocation());
-
-            _mappedElements.put(finalValue, element);
-        }
-    }
-
-    public List getElements()
-    {
-        return _elements;
-    }
-
-    public Map getMappedElements()
-    {
-        if (_canElementsBeMapped)
-            return _mappedElements;
-
-        return null;
-    }
-
     public void push(Object object)
     {
         _stack.add(object);
@@ -162,9 +113,16 @@
 
     /** @since 1.1 */
 
+    public String getDefiningModuleId()
+    {
+        return _schema.getDefiningModuleId();
+    }
+    
     public Module getDefiningModule()
     {
-        return _schema.getDefiningModule();
+        Module definingModule = getContributingModule().getModule(_schema.getDefiningModuleId());
+        Defense.notNull(definingModule, "Defining module");
+        return definingModule;
     }
 
     public String getElementPath()
@@ -188,11 +146,6 @@
         _elementStack.add(element);
     }
 
-    private Element peekElement()
-    {
-        return (Element) _elementStack.get(_elementStack.size() - 1);
-    }
-
     private void popElement()
     {
         _elementStack.remove(_elementStack.size() - 1);
@@ -200,17 +153,21 @@
 
     /**
      * Processes a single extension.
+     * @param container  the configuration container in that the contribution is placed
      */
-    public void process(List elements, Module contributingModule)
+    public void process(Object container, List elements, Module contributingModule)
     {
         if (elements == null)
             return;
 
         if (_schema == null)
         {
-            _elements.addAll(elements);
             return;
         }
+        Defense.notNull(contributingModule, "Contributing module");
+        
+        // Move the container to the stack as top level element
+        push(container);
 
         _contributingModule = contributingModule;
 
@@ -222,7 +179,7 @@
 
             processRootElement(e);
         }
-
+        
         _contributingModule = null;
     }
 
@@ -295,6 +252,8 @@
 
     public Translator getTranslator(String translator)
     {
-        return getContributingModule().getTranslator(translator);
+        XmlRegistryNature xmlNature = (XmlRegistryNature) getContributingModule().getRegistryNature(XmlRegistryNature.class);
+        TranslatorManager translatorManager = xmlNature.getTranslationManager();
+        return translatorManager.getTranslator(translator);
     }
 }

Copied: jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java (from r413141, jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java)
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java?p2=jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java&p1=jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java&r1=413141&r2=413747&rev=413747&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java Mon Jun 12 14:44:52 2006
@@ -14,10 +14,13 @@
 
 package org.apache.hivemind.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.InterceptorStack;
 import org.apache.hivemind.ServiceInterceptorFactory;
+import org.apache.hivemind.impl.natures.XmlServicePointNature;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceInterceptorContribution;
 import org.apache.hivemind.internal.ServicePoint;
@@ -104,14 +107,21 @@
             _factory = (ServiceInterceptorFactory) factoryPoint
                     .getService(ServiceInterceptorFactory.class);
 
-            Schema schema = factoryPoint.getParametersSchema();
+            XmlServicePointNature xmlNature = (XmlServicePointNature) factoryPoint.getNature(XmlServicePointNature.class);
+            if (xmlNature == null) {
+                // TODO:
+                throw new ApplicationRuntimeException("ServicePoint has no xml nature");
+            }
+
+            Schema schema = xmlNature.getParametersSchema();
 
             SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
                     schema);
 
-            processor.process(_parameters, _contributingModule);
+            // TODO annotations: implement more generic parameter container
+            _convertedParameters = new ArrayList();
+            processor.process(_convertedParameters, _parameters, _contributingModule);
 
-            _convertedParameters = processor.getElements();
         }
     }
 



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