hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r464932 - in /hivemind/branches/branch-2-0-annot: framework/src/java/org/apache/hivemind/definition/construction/ framework/src/java/org/apache/hivemind/impl/ framework/src/java/org/apache/hivemind/impl/servicemodel/ framework/src/java/org/...
Date Tue, 17 Oct 2006 14:30:53 GMT
Author: ahuegen
Date: Tue Oct 17 07:30:52 2006
New Revision: 464932

URL: http://svn.apache.org/viewvc?view=rev&rev=464932
Log:
Refactored module interface

Modified:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InterceptorStackImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ModuleImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/natures/XmlRegistryNature.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/rules/RuleUtils.java
    hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/config/TestConfigurationPoint.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestXmlModuleDescriptorProcessor.java

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
Tue Oct 17 07:30:52 2006
@@ -3,6 +3,7 @@
 import org.apache.hivemind.definition.ExtensionDefinition;
 import org.apache.hivemind.definition.ExtensionPointDefinition;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.RegistryInfrastructure;
 
 /**
  * Interface that provides access to information and services needed
@@ -29,7 +30,14 @@
     public Object getService(Class serviceInterface);
     
     /**
+     * @see Module#containsService(Class)
+     */
+    public boolean containsService(Class serviceInterface);
+
+    /**
      * @see Module#getConfiguration(String, Class)
      */
     public Object getConfiguration(String configurationId);
+    
+    public RegistryInfrastructure getRegistry();
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
Tue Oct 17 07:30:52 2006
@@ -196,7 +196,7 @@
             for (int i = 0; i < count; i++)
             {
                 ContributionDefinition cd = (ContributionDefinition) _contributions.get(i);
-                Module definingModule = getModule().getModule(cd.getModuleId());
+                Module definingModule = getModule().getRegistry().getModule(cd.getModuleId());
                 ContributionConstructionContext context = new ConfigurationConstructionContextImpl(definingModule,
this);
                 cd.getContributionConstructor().contribute(context, _container);
             }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InterceptorStackImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InterceptorStackImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InterceptorStackImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/InterceptorStackImpl.java
Tue Oct 17 07:30:52 2006
@@ -111,7 +111,7 @@
         try
         {
             _interceptorDefinition = interceptorDefinition;
-            Module contributingModule = getServiceModule().getModule(interceptorDefinition.getModuleId());
+            Module contributingModule = getServiceModule().getRegistry().getModule(interceptorDefinition.getModuleId());
             _interceptorDefinition.getInterceptorConstructor().constructServiceInterceptor(this,
contributingModule);
         }
         finally

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ModuleImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ModuleImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ModuleImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ModuleImpl.java
Tue Oct 17 07:30:52 2006
@@ -203,16 +203,11 @@
     }
 
     /**
-     * @see org.apache.hivemind.internal.Module#getRegistryNature(java.lang.Class)
+     * @see org.apache.hivemind.internal.Module#getRegistry()
      */
-    public Object getRegistryNature(Class natureType)
+    public RegistryInfrastructure getRegistry()
     {
-        return _registry.getNature(natureType);
+        return _registry;
     }
     
-    public Module getModule(String moduleId)
-    {
-        return _registry.getModule(moduleId);
-    }
-
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java
Tue Oct 17 07:30:52 2006
@@ -31,6 +31,7 @@
 import org.apache.hivemind.impl.ProxyBuilder;
 import org.apache.hivemind.internal.ImplementationConstructionContextImpl;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.RegistryInfrastructure;
 import org.apache.hivemind.internal.ServiceModel;
 import org.apache.hivemind.service.ClassFab;
 import org.apache.hivemind.util.ConstructorUtils;
@@ -112,8 +113,8 @@
         ImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
         // Get a reference to the module that provided the implementation 
         String definingModuleId = implementationDefinition.getModuleId();
-        // Is there a more elegant way to retrieve a module?
-        Module definingModule = _servicePoint.getModule().getModule(definingModuleId);
+        
+        Module definingModule = getRegistry().getModule(definingModuleId);
         ImplementationConstructionContext context = new ImplementationConstructionContextImpl(definingModule,
                 _servicePoint);
         Object result = constructor.constructCoreServiceImplementation(context);
@@ -136,6 +137,11 @@
         HiveMind.setLocation(result, constructor.getLocation());
 
         return result;
+    }
+
+    private RegistryInfrastructure getRegistry()
+    {
+        return _servicePoint.getModule().getRegistry();
     }
 
     /**

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java
Tue Oct 17 07:30:52 2006
@@ -44,5 +44,21 @@
     {
         return _definingModule.getService(serviceInterface);
     }
+    
+    /**
+     * @see org.apache.hivemind.definition.construction.ConstructionContext#containsService(java.lang.Class)
+     */
+    public boolean containsService(Class serviceInterface)
+    {
+        return _definingModule.containsService(serviceInterface);
+    }
+
+    /**
+     * @see org.apache.hivemind.definition.construction.ConstructionContext#getRegistry()
+     */
+    public RegistryInfrastructure getRegistry()
+    {
+        return getDefiningModule().getRegistry();
+    }
 
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Module.java
Tue Oct 17 07:30:52 2006
@@ -149,16 +149,8 @@
     public ErrorHandler getErrorHandler();
     
     /**
-     * Retrieves a registry nature.
-     * @see RegistryInfrastructure#addNature(Class, Object)
+     * @return the registry infrastructure interface
      */
-    public Object getRegistryNature(Class natureType);
-    
-    /**
-     * Retrieves another module from the registry.
-     * @param moduleId
-     * @return the module
-     */
-    public Module getModule(String moduleId);
+    public RegistryInfrastructure getRegistry();
     
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
Tue Oct 17 07:30:52 2006
@@ -37,7 +37,7 @@
     {
         DefaultErrorHandler errorHandler = new DefaultErrorHandler();
 
-    	RegistryDefinition definition = new RegistryDefinition(errorHandler);
+    	RegistryDefinition definition = new RegistryDefinition();
     	
         ModuleDefinition fooBar = createModuleDefinition("foo.bar");
 

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
(original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
Tue Oct 17 07:30:52 2006
@@ -25,7 +25,6 @@
 import org.apache.hivemind.definition.ServiceImplementationDefinition;
 import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.definition.construction.ImplementationConstructor;
-import org.apache.hivemind.impl.DefaultErrorHandler;
 import org.apache.hivemind.impl.InterceptorStackImpl;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceModel;
@@ -122,7 +121,7 @@
      */
     private Registry createRegistry(ImplementationConstructor constructor)
     {
-        RegistryDefinition definition = new RegistryDefinition(new DefaultErrorHandler());
+        RegistryDefinition definition = new RegistryDefinition();
 
         ModuleDefinition module = createModuleDefinition("hivemind.tests.serviceByInterface");
         definition.addModule(module);

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ant/RegistrySerializer.java
Tue Oct 17 07:30:52 2006
@@ -38,6 +38,7 @@
 import org.apache.hivemind.definition.construction.ImplementationConstructor;
 import org.apache.hivemind.impl.CreateClassServiceConstructor;
 import org.apache.hivemind.impl.DefaultErrorHandler;
+import org.apache.hivemind.impl.ExtensionResolver;
 import org.apache.hivemind.impl.InvokeFactoryServiceConstructor;
 import org.apache.hivemind.impl.RegistryBuilder;
 import org.apache.hivemind.impl.natures.XmlConfigurationPointNature;
@@ -105,7 +106,8 @@
     public Document createRegistryDocument(RegistryDefinition registryDefinition)
     {
         _registryDefinition = registryDefinition;
-        _registryDefinition.resolveExtensions();
+        ExtensionResolver resolver = new ExtensionResolver(_handler, _registryDefinition);
+        resolver.resolveExtensions();
         
         DocumentBuilder builder = getBuilder();
 

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
Tue Oct 17 07:30:52 2006
@@ -90,7 +90,7 @@
                 // TODO annotations: Externalize message
                 throw new ApplicationRuntimeException("ServicePoint has no xml nature");
             }
-            XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistryNature(XmlRegistryNature.class);
+            XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistry().getNature(XmlRegistryNature.class);
             TranslatorManager translatorManager = xmlRegistryNature.getTranslationManager();
 
             Schema schema = xmlNature.getParametersSchema();

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
Tue Oct 17 07:30:52 2006
@@ -91,7 +91,7 @@
                 // TODO annotations:
                 throw new ApplicationRuntimeException("ServicePoint has no xml nature");
             }
-            XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistryNature(XmlRegistryNature.class);
+            XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistry().getNature(XmlRegistryNature.class);
             TranslatorManager translatorManager = xmlRegistryNature.getTranslationManager();
 
             _factory = (ServiceImplementationFactory) factoryPoint

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
Tue Oct 17 07:30:52 2006
@@ -182,7 +182,7 @@
     
     public Module getDefiningModule()
     {
-        Module definingModule = getContributingModule().getModule(_schema.getDefiningModuleId());
+        Module definingModule = getContributingModule().getRegistry().getModule(_schema.getDefiningModuleId());
         Defense.notNull(definingModule, "Defining module");
         return definingModule;
     }

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java
Tue Oct 17 07:30:52 2006
@@ -77,7 +77,7 @@
         
         Module contributingModule = context.getDefiningModule();
 
-        XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistryNature(XmlRegistryNature.class);
+        XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) contributingModule.getRegistry().getNature(XmlRegistryNature.class);
         TranslatorManager translatorManager = xmlRegistryNature.getTranslationManager();
 
         Schema contributionsSchema = xmlNature.getSchema();

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/natures/XmlRegistryNature.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/natures/XmlRegistryNature.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/natures/XmlRegistryNature.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/natures/XmlRegistryNature.java
Tue Oct 17 07:30:52 2006
@@ -30,7 +30,6 @@
     public TranslatorManager getTranslationManager()
     {
         if (_translationManager == null) {
-            // TODO: Referenz auf Infrastructure besorgen
             _translationManager = new TranslatorManagerImpl(_registry, _errorHandler);
         }
         

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/rules/RuleUtils.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/rules/RuleUtils.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/rules/RuleUtils.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/rules/RuleUtils.java
Tue Oct 17 07:30:52 2006
@@ -152,7 +152,7 @@
         if (translator == null)
             return new NullTranslator();
         
-        XmlRegistryNature xmlNature = (XmlRegistryNature) processor.getContributingModule().getRegistryNature(XmlRegistryNature.class);
+        XmlRegistryNature xmlNature = (XmlRegistryNature) processor.getContributingModule().getRegistry().getNature(XmlRegistryNature.class);
         TranslatorManager translatorManager = xmlNature.getTranslationManager();
 
         return translatorManager.getTranslator(translator);

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/config/TestConfigurationPoint.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/config/TestConfigurationPoint.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/config/TestConfigurationPoint.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/config/TestConfigurationPoint.java
Tue Oct 17 07:30:52 2006
@@ -30,7 +30,6 @@
 import org.apache.hivemind.Element;
 import org.apache.hivemind.Registry;
 import org.apache.hivemind.Resource;
-import org.apache.hivemind.definition.RegistryDefinition;
 import org.apache.hivemind.impl.RegistryBuilder;
 import org.apache.hivemind.impl.XmlModuleReader;
 import org.apache.hivemind.util.ClasspathResource;
@@ -339,7 +338,7 @@
     public void testTooFew() throws Exception
     {
 
-        interceptLogging(RegistryDefinition.class.getName());
+        interceptLogging(RegistryBuilder.class.getName());
 
         Registry r = buildFrameworkRegistry("TooFew.xml");
 
@@ -351,7 +350,7 @@
 
     public void testTooMany() throws Exception
     {
-        interceptLogging(RegistryDefinition.class.getName());
+        interceptLogging(RegistryBuilder.class.getName());
 
         Registry r = buildFrameworkRegistry("TooMany.xml");
 

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
Tue Oct 17 07:30:52 2006
@@ -31,6 +31,7 @@
 import org.apache.hivemind.impl.natures.XmlServicePointNature;
 import org.apache.hivemind.internal.ImplementationConstructionContextImpl;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.RegistryInfrastructure;
 import org.apache.hivemind.internal.ServicePoint;
 import org.apache.hivemind.schema.impl.SchemaImpl;
 import org.apache.hivemind.xml.XmlTestCase;
@@ -48,6 +49,9 @@
         MockControl moduleControl = newControl(Module.class);
         Module module = (Module) moduleControl.getMock();
 
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
+
         MockControl factoryPointControl = newControl(ServicePoint.class);
         ServicePoint factoryPoint = (ServicePoint) factoryPointControl.getMock();
 
@@ -84,8 +88,11 @@
         module.getServicePoint("foo.bar.Baz");
         moduleControl.setReturnValue(factoryPoint);
         
-        module.getRegistryNature(XmlRegistryNature.class);
-        moduleControl.setReturnValue(xmlRegistryNature);
+        module.getRegistry();
+        moduleControl.setReturnValue(registry);
+        
+        registry.getNature(XmlRegistryNature.class);
+        registryControl.setReturnValue(xmlRegistryNature);
         
         module.resolveType(ArrayList.class.getName());
         moduleControl.setReturnValue(ArrayList.class);

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
Tue Oct 17 07:30:52 2006
@@ -29,6 +29,7 @@
 import org.apache.hivemind.Location;
 import org.apache.hivemind.TranslatorManager;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.RegistryInfrastructure;
 import org.apache.hivemind.schema.SchemaProcessor;
 import org.apache.hivemind.schema.Translator;
 import org.apache.hivemind.schema.impl.AttributeModelImpl;
@@ -56,6 +57,9 @@
         MockControl control = newControl(Module.class);
         Module m = (Module) control.getMock();
         
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
+        
         MockControl tmControl = newControl(TranslatorManager.class);
         TranslatorManager tm = (TranslatorManager) tmControl.getMock();
 
@@ -84,8 +88,11 @@
 
         List elements = Collections.singletonList(element);
         
-        m.getModule("module");
-        control.setReturnValue(m);
+        m.getRegistry();
+        control.setReturnValue(registry);
+        
+        registry.getModule("module");
+        registryControl.setReturnValue(m);
 
         m.resolveType("hivemind.test.services.impl.StringHolderImpl");
         control.setReturnValue(StringHolderImpl.class);
@@ -114,6 +121,9 @@
         MockControl control = newControl(Module.class);
         Module m = (Module) control.getMock();
         
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
+
         MockControl tmControl = newControl(TranslatorManager.class);
         TranslatorManager tm = (TranslatorManager) tmControl.getMock();
 
@@ -141,10 +151,13 @@
         element.setContent("flintstone");
 
         List elements = Collections.singletonList(element);
-
-        m.getModule(schema.getDefiningModuleId());
-        control.setReturnValue(m);
         
+        m.getRegistry();
+        control.setReturnValue(registry);
+        
+        registry.getModule(schema.getDefiningModuleId());
+        registryControl.setReturnValue(m);
+
         m.resolveType("hivemind.test.services.impl.StringHolderImpl");
         control.setReturnValue(StringHolderImpl.class);
 
@@ -169,6 +182,9 @@
         MockControl control = newControl(Module.class);
         Module m = (Module) control.getMock();
         
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
+
         MockControl tmControl = newControl(TranslatorManager.class);
         TranslatorManager tm = (TranslatorManager) tmControl.getMock();
 
@@ -202,8 +218,11 @@
 
         List elements = Collections.singletonList(element);
         
-        m.getModule("module");
-        control.setReturnValue(m);
+        m.getRegistry();
+        control.setReturnValue(registry);
+        
+        registry.getModule("module");
+        registryControl.setReturnValue(m);
 
         m.resolveType("hivemind.test.services.impl.StringHolderImpl");
         control.setReturnValue(StringHolderImpl.class);
@@ -261,6 +280,9 @@
         
         MockControl tmControl = newControl(TranslatorManager.class);
         TranslatorManager tm = (TranslatorManager) tmControl.getMock();
+        
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
 
         em.setElementName("cartoon");
         em.setKeyAttribute("name");
@@ -295,9 +317,12 @@
 
         List elements = Collections.singletonList(element);
 
-        m.getModule("module");
-        control.setReturnValue(m);
+        m.getRegistry();
+        control.setReturnValue(registry);
         
+        registry.getModule("module");
+        registryControl.setReturnValue(m);
+
         m.resolveType("StringHolderImpl");
         control.setReturnValue(StringHolderImpl.class);
         
@@ -367,6 +392,9 @@
 
         MockControl control2 = newControl(Module.class);
         Module m2 = (Module) control2.getMock();
+        
+        MockControl registryControl = newControl(RegistryInfrastructure.class);
+        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
 
         SchemaProcessorImpl p = new SchemaProcessorImpl(null, schema);
 
@@ -392,11 +420,17 @@
         MockControl tmControl = newControl(TranslatorManager.class);
         TranslatorManager tm = (TranslatorManager) tmControl.getMock();
         
-        m1.getModule("module");
-        control1.setReturnValue(m1);
+        m1.getRegistry();
+        control1.setReturnValue(registry);
+        
+        registry.getModule("module");
+        registryControl.setReturnValue(m1);
+
+        m2.getRegistry();
+        control2.setReturnValue(registry);
         
-        m2.getModule("module");
-        control2.setReturnValue(m2);
+        registry.getModule("module");
+        registryControl.setReturnValue(m2);
         
         m1.resolveType("StringHolderImpl");
         control1.setReturnValue(StringHolderImpl.class);

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestXmlModuleDescriptorProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestXmlModuleDescriptorProcessor.java?view=diff&rev=464932&r1=464931&r2=464932
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestXmlModuleDescriptorProcessor.java
(original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestXmlModuleDescriptorProcessor.java
Tue Oct 17 07:30:52 2006
@@ -52,7 +52,7 @@
         schema.setId("Baz");
 
         DefaultErrorHandler errorHandler = new DefaultErrorHandler();
-        RegistryDefinition definition = new RegistryDefinition(errorHandler);
+        RegistryDefinition definition = new RegistryDefinition();
 
         ModuleDescriptor fooBar = new ModuleDescriptor(null, errorHandler);
         fooBar.setModuleId("foo.bar");
@@ -96,7 +96,7 @@
         schema.setId("Baz");
         schema.setVisibility(Visibility.PRIVATE);
 
-        RegistryDefinition definition = new RegistryDefinition(errorHandler);
+        RegistryDefinition definition = new RegistryDefinition();
 
         Location l = newLocation();
 
@@ -138,7 +138,7 @@
 
         Log log = LogFactory.getLog(XmlModuleDescriptorProcessor.class);
 
-        RegistryDefinition definition = new RegistryDefinition(errorHandler);
+        RegistryDefinition definition = new RegistryDefinition();
 
         Location l = newLocation();
 
@@ -177,7 +177,7 @@
     {
         ErrorHandler errorHandler = new DefaultErrorHandler();
 
-        RegistryDefinition definition = new RegistryDefinition(errorHandler);
+        RegistryDefinition definition = new RegistryDefinition();
 
         replayControls();
 
@@ -202,7 +202,8 @@
                 errorHandler);
         processor.processModuleDescriptor(md);
 
-        definition.resolveExtensions();
+        ExtensionResolver extensionResolver = new ExtensionResolver(new StrictErrorHandler(),
definition);
+        extensionResolver.resolveExtensions();
 
         ConfigurationPointDefinition configurationPoint = definition
                 .getConfigurationPoint("zip.zoop.Fred");
@@ -216,7 +217,7 @@
     {
         ErrorHandler errorHandler = new DefaultErrorHandler();
 
-        RegistryDefinition definition = new RegistryDefinition(errorHandler);
+        RegistryDefinition definition = new RegistryDefinition();
 
         replayControls();
 
@@ -241,7 +242,8 @@
                 errorHandler);
         processor.processModuleDescriptor(md);
 
-        definition.resolveExtensions();
+        ExtensionResolver extensionResolver = new ExtensionResolver(new StrictErrorHandler(),
definition);
+        extensionResolver.resolveExtensions();
 
         ConfigurationPointDefinition configurationPoint = definition
                 .getConfigurationPoint("zip.zoop.Fred");
@@ -256,7 +258,7 @@
         MockControl ehControl = newControl(ErrorHandler.class);
         ErrorHandler eh = (ErrorHandler) ehControl.getMock();
 
-        RegistryDefinition definition = new RegistryDefinition(eh);
+        RegistryDefinition definition = new RegistryDefinition();
 
         Log log = LogFactory.getLog(XmlModuleDescriptorProcessor.class);
 
@@ -293,7 +295,8 @@
         XmlModuleDescriptorProcessor processor = new XmlModuleDescriptorProcessor(definition,
eh);
         processor.processModuleDescriptor(md);
 
-        definition.resolveExtensions();
+        ExtensionResolver extensionResolver = new ExtensionResolver(new StrictErrorHandler(),
definition);
+        extensionResolver.resolveExtensions();
 
         ConfigurationPointDefinition configurationPoint = definition
                 .getConfigurationPoint("zip.zoop.Fred");



Mime
View raw message