hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r415203 - in /jakarta/hivemind/branches/branch-2-0-annot: examples/src/java/org/apache/examples/impl/ framework/src/java/org/apache/hivemind/ framework/src/java/org/apache/hivemind/definition/ framework/src/java/org/apache/hivemind/impl/ fr...
Date Sun, 18 Jun 2006 21:56:43 GMT
Author: ahuegen
Date: Sun Jun 18 14:56:39 2006
New Revision: 415203

URL: http://svn.apache.org/viewvc?rev=415203&view=rev
Log:
Next part of the refactoring aimed at annotation support
Fixed and moved unit tests to xml module. 

Removed:
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceImplementationFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceImplementationFactoryParameters.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServiceImplementationFactoryParametersImpl.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/MissingSubModule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/NestedSubmodule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/OuterModule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/SimpleModuleDescriptorProvider.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/Submodule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestContains.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestSubModule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/ant/
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/AttributeDefaults.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/BadAttributes.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/BadElement.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Basics.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Basics2.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/BooleanTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ComplexAttributeName.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ComplexNameItem.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ConversionParentMethod.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/CustomRule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/CustomRuleFailure.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/DataItem.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/DuplicateAttribute.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Empty.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ExtraAttributeNames.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Frobable.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/InstanceTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/IntTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Localized.properties
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Localized.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Localized_fr.properties
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Nested.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/NoSchema.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Null.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ObjectTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/ResourceTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/SetContributingModuleRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/SetParent.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Simple.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Structured.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/Symbols.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConfigurationPoint.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestConversion.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TestUniqueElementAttribute.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TooFew.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/TooMany.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/UniqueAttributeBroken.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/UniqueAttributeDefinition.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/UnknownContribution.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/config/impl/
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/contains.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/parse/
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/ConfigurationTranslator.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/DatumHolder.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/IntHolder.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/InvokeFailure.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/MappedDatumHolder.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/PrivateObject.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/SetPropertyRule.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestBooleanTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConfigurationTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestConvertInitializer.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestEnumerationTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInstanceTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestInvokeParentRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestPushAttributeRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestPushContentRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestReadAttributeRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestServicePointTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetModule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSetPropertyRule.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TestSmartTranslator.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/TruthTeller.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/WrongType.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/rules/impl/
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/servicesByInterface.xml
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/conditional/
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestSchemaProcessor.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/test/org/apache/hivemind/lib/groovy/TestGroovyModuleDescriptorProvider.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/test/org/apache/hivemind/lib/groovy/TestHiveMindBuilder.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/test/org/apache/hivemind/lib/groovy/basic.groovy
    jakarta/hivemind/branches/branch-2-0-annot/library/src/test/org/apache/hivemind/lib/groovy/calculator.groovy
    jakarta/hivemind/branches/branch-2-0-annot/library/src/test/org/apache/hivemind/lib/groovy/missingModuleId.groovy
Modified:
    jakarta/hivemind/branches/branch-2-0-annot/examples/src/java/org/apache/examples/impl/ProxyLoggingInterceptorFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestDependency.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestRegistryBuilder.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/CountFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/TrackerFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestVisibility.java
    jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestObjectProviders.java
    jakarta/hivemind/branches/branch-2-0-annot/jmx/src/descriptor/META-INF/jmx-connector-module.xml
    jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/JMXConnectorServerFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/PerformanceMonitorFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/factory/BeanFactoryBuilder.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/EJBProxyFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/ServicePropertyFactory.java
    jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/pipeline/PipelineFactory.java

Modified: jakarta/hivemind/branches/branch-2-0-annot/examples/src/java/org/apache/examples/impl/ProxyLoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/examples/src/java/org/apache/examples/impl/ProxyLoggingInterceptorFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/examples/src/java/org/apache/examples/impl/ProxyLoggingInterceptorFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/examples/src/java/org/apache/examples/impl/ProxyLoggingInterceptorFactory.java Sun Jun 18 14:56:39 2006
@@ -16,7 +16,6 @@
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
-import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.hivemind.InterceptorStack;
@@ -32,7 +31,7 @@
 public class ProxyLoggingInterceptorFactory implements ServiceInterceptorFactory
 {
 
-    public void createInterceptor(InterceptorStack stack, Module invokingModule, List parameters)
+    public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters)
     {
         Log log = stack.getServiceLog();
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java Sun Jun 18 14:56:39 2006
@@ -33,8 +33,8 @@
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceInterceptorContribution;
 import org.apache.hivemind.internal.ServicePoint;
-import org.apache.hivemind.parse.ContributionDescriptor;
 import org.apache.hivemind.schema.SchemaProcessor;
+import org.apache.hivemind.util.IdUtils;
 
 /**
  * Used to format messages used in errors and log output for classes within the impl package.
@@ -172,12 +172,13 @@
                 .getServiceConstructor().getContributingModuleId());
     }
 
-    static String wrongNumberOfContributions(ConfigurationPoint point, int actualCount,
+    static String wrongNumberOfContributions(ModuleDefinition definingModule, ConfigurationPointDefinition point, int actualCount,
             Occurances expectation)
     {
+        String fullyQualifiedId = IdUtils.qualify(definingModule.getId(), point.getId());
         return _formatter.format(
                 "wrong-number-of-contributions",
-                point.getExtensionPointId(),
+                fullyQualifiedId,
                 contributionCount(actualCount),
                 occurances(expectation));
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties Sun Jun 18 14:56:39 2006
@@ -61,7 +61,6 @@
 sub-module-does-not-exist=Sub-module {0} does not exist.
 
 dependency-on-unknown-module=Required module {0} does not exist.
-dependency-version-mismatch=Version of required module {0} does not match expected version {1}.
 
 unlocated-error=Error: {0}
 located-error=Error at {0}: {1}

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java Sun Jun 18 14:56:39 2006
@@ -10,6 +10,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hivemind.ErrorHandler;
+import org.apache.hivemind.Occurances;
 import org.apache.hivemind.impl.RegistryPostProcessor;
 import org.apache.hivemind.util.IdUtils;
 
@@ -175,7 +176,7 @@
     }
 
     /**
-     * Resolves all extensions, that couldn't be resolved already because the extension was added
+     * Resolves all extensions, that couldn't be resolved before because the extension was added
      * before the referenced extension point.
      */
     public void resolveExtensions()
@@ -252,6 +253,68 @@
             }
 
         }
+    }
+
+    public void checkDependencies()
+    {
+        for (Iterator iterModules = _modules.values().iterator(); iterModules.hasNext();)
+        {
+            ModuleDefinition module = (ModuleDefinition) iterModules.next();
+            
+            for (Iterator iterDependencies = module.getDependencies().iterator(); iterDependencies.hasNext();)
+            {
+                String requiredModuleId = (String) iterDependencies.next();
+                checkModuleDependency(module, requiredModuleId);
+            }
+        }
+        
+    }
+
+    private void checkModuleDependency(ModuleDefinition sourceModule, String requiredModuleId)
+    {
+        ModuleDefinition requiredModule = (ModuleDefinition) _modules.get(requiredModuleId);
+        if (requiredModule == null)
+        {
+            // TODO annotation: Location in Dependencies aufnehmen
+            _errorHandler.error(
+                    LOG,
+                    ImplMessages.dependencyOnUnknownModule(requiredModuleId),
+                    null,
+                    null);
+            return;
+        }
+    }
+    
+    /**
+     * Checks that each configuration extension point has the right number of contributions.
+     */
+    public void checkContributionCounts()
+    {
+        for (Iterator iterModules = _modules.values().iterator(); iterModules.hasNext();)
+        {
+            ModuleDefinition module = (ModuleDefinition) iterModules.next();
+            
+            for (Iterator iterConfigurations = module.getConfigurationPoints().iterator(); iterConfigurations.hasNext();)
+            {
+                ConfigurationPointDefinition cpd = (ConfigurationPointDefinition) iterConfigurations.next();
+                checkContributionCounts(module, cpd);
+            }
+        }
+    }
+    
+    private void checkContributionCounts(ModuleDefinition definingModule, ConfigurationPointDefinition configurationPoint)
+    {
+        Occurances expected = configurationPoint.getExpectedContributions();
+
+        int actual = configurationPoint.getContributions().size();
+
+        if (expected.inRange(actual))
+            return;
+
+        _errorHandler.error(LOG, ImplMessages.wrongNumberOfContributions(
+                definingModule, configurationPoint,
+                actual,
+                expected), configurationPoint.getLocation(), null);
     }
 
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java Sun Jun 18 14:56:39 2006
@@ -196,7 +196,7 @@
     {
         Object container = _constructor.constructConfigurationContainer(getModule());
         if (container == null)
-            // TODO AH: better exception
+            // TODO annotations: i18n message
             throw new ApplicationRuntimeException("configuration container is null");
 
         if (!lookupContainerClass().isAssignableFrom(container.getClass()))
@@ -239,5 +239,5 @@
     {
         _constructor = constructor;
     }
-
+    
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties Sun Jun 18 14:56:39 2006
@@ -61,7 +61,6 @@
 sub-module-does-not-exist=Sub-module {0} does not exist.
 
 dependency-on-unknown-module=Required module {0} does not exist.
-dependency-version-mismatch=Version of required module {0} does not match expected version {1}.
 
 unlocated-error=Error: {0}
 located-error=Error at {0}: {1}

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java Sun Jun 18 14:56:39 2006
@@ -21,7 +21,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hivemind.ErrorHandler;
-import org.apache.hivemind.ModuleDescriptorProvider;
 import org.apache.hivemind.Registry;
 import org.apache.hivemind.definition.RegistryDefinition;
 import org.apache.hivemind.internal.RegistryInfrastructure;
@@ -105,6 +104,8 @@
         RegistryDefinition definition = getRegistryDefinition();
         
         definition.resolveExtensions();
+        definition.checkDependencies();
+        definition.checkContributionCounts();
         
         // Post process phase
         for (Iterator i = definition.getPostProcessors().iterator(); i.hasNext();)

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java Sun Jun 18 14:56:39 2006
@@ -224,7 +224,9 @@
     {
         ServiceImplementationDefinition impl = sd.getDefaultImplementation();
 
-        if (impl != null) {
+        if (impl == null) {
+            // TODO annotations: error ?
+        } else {
             if (_log.isDebugEnabled())
                 _log.debug("Adding implementation to service extension point " + point.getExtensionPointId());
     
@@ -242,7 +244,6 @@
             point.setServiceModel(impl.getServiceModel());
             point.setServiceConstructor(impl.getServiceConstructor(), true);
         }
-
     }
     
     private void addContributions(ConfigurationPointDefinition cpd, ConfigurationPointImpl point, Module sourceModule)

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java Sun Jun 18 14:56:39 2006
@@ -246,9 +246,9 @@
     public void createInterceptor(
         InterceptorStack stack,
         Module contributingModule,
-        List parameters)
+        Object parameters)
     {
-        Class interceptorClass = constructInterceptorClass(stack, parameters);
+        Class interceptorClass = constructInterceptorClass(stack, (List) parameters);
 
         try
         {

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=415203&r1=415202&r2=415203&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 Sun Jun 18 14:56:39 2006
@@ -432,6 +432,11 @@
 
         return builder.constructRegistry(Locale.getDefault());
     }
+    
+    protected Registry buildFrameworkRegistry(ModuleDefinition customModule)
+    {
+        return buildFrameworkRegistry(new ModuleDefinition[] {customModule});
+    }
 
     /**
      * Builds a registry, containing only the modules delivered the parameter

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=415203&r1=415202&r2=415203&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 Sun Jun 18 14:56:39 2006
@@ -19,16 +19,17 @@
 
 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.ServiceImplementationDefinition;
 import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.impl.CreateClassServiceConstructor;
 import org.apache.hivemind.impl.DefaultClassResolver;
-import org.apache.hivemind.impl.DefaultErrorHandler;
+import org.apache.hivemind.internal.ServiceImplementationConstructor;
+import org.apache.hivemind.internal.ServiceModel;
 import org.apache.hivemind.internal.Visibility;
+import org.apache.hivemind.parse.ConfigurationPointDescriptor;
 import org.apache.hivemind.parse.DependencyDescriptor;
-import org.apache.hivemind.parse.ModuleDescriptor;
-import org.apache.hivemind.parse.XmlResourceProcessor;
 import org.apache.hivemind.test.HiveMindTestCase;
 
 /**
@@ -55,19 +56,6 @@
         return url.getPath();
     }
 
-    protected ModuleDescriptor parse(String file)
-        throws Exception
-    {
-        Resource location = getResource(file);
-        DefaultErrorHandler eh = new DefaultErrorHandler();
-
-        XmlResourceProcessor p = new XmlResourceProcessor(_resolver, eh);
-
-        ModuleDescriptor result = p.processResource(location);
-
-        return result;
-    }
-
     protected void interceptLogging()
     {
         interceptLogging("org.apache.hivemind");
@@ -77,7 +65,7 @@
      * Convenience method for creating a
      * {@link ModuleDefinition}.
      */
-    protected ModuleDefinition createModuleDefinition(String moduleId, String version)
+    protected ModuleDefinition createModuleDefinition(String moduleId)
     {
         ModuleDefinition result = new ModuleDefinition(moduleId, newLocation(), 
                 getClassResolver(), "");
@@ -106,7 +94,19 @@
     protected ServicePointDefinition createServicePointDefinition(String pointId, Class serviceInterface)
     {
         ServicePointDefinition result = new ServicePointDefinition(pointId,
-                newLocation(), Visibility.PUBLIC, serviceInterface.getClass().getName());
+                newLocation(), Visibility.PUBLIC, serviceInterface.getName());
+
+        return result;
+    }
+    
+    /**
+     * Convenience method for creating a {@link ServiceImplementationDefinition}.
+     */
+    protected ServiceImplementationDefinition createServiceImplementationDefinition(Class serviceImplementationClass)
+    {
+        ServiceImplementationDefinition result = new ServiceImplementationDefinition(newLocation(),
+                new CreateClassServiceConstructor("module", serviceImplementationClass.getName()), 
+                "singleton", true);
 
         return result;
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestDependency.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestDependency.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestDependency.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestDependency.java Sun Jun 18 14:56:39 2006
@@ -14,8 +14,7 @@
 
 package hivemind.test;
 
-import org.apache.hivemind.parse.DependencyDescriptor;
-import org.apache.hivemind.parse.ModuleDescriptor;
+import org.apache.hivemind.definition.ModuleDefinition;
 
 /**
  * Tests the module dependencies (specified using <dependency.>).
@@ -27,67 +26,28 @@
 
     public void testMissingRequiredModule() throws Exception
     {
-        ModuleDescriptor dependingModule = createModuleDescriptor(
-                "dependency.declaring.module",
-                null);
-
-        DependencyDescriptor unresolvableDependency = createDependencyDescriptor(
-                "required.module",
-                null);
-        dependingModule.addDependency(unresolvableDependency);
+        ModuleDefinition dependingModule = createModuleDefinition(
+                "dependency.declaring.module");
 
-        SimpleModuleDescriptorProvider provider = new SimpleModuleDescriptorProvider();
-        provider.addModuleDescriptor(dependingModule);
+        dependingModule.addDependency("required.module");
 
         interceptLogging();
 
-        buildFrameworkRegistry(provider);
+        buildFrameworkRegistry(new ModuleDefinition[] {dependingModule});
 
         assertLoggedMessage("Required module required.module does not exist.");
     }
 
-    public void testDependencyWithoutVersion() throws Exception
+    public void testDependency() throws Exception
     {
-        ModuleDescriptor dependingModule = createModuleDescriptor(
-                "dependency.declaring.module",
-                null);
-
-        ModuleDescriptor requiredModule = createModuleDescriptor("required.module", "1.0.0");
-
-        DependencyDescriptor unversionedDependency = createDependencyDescriptor(
-                "required.module",
-                null);
-        dependingModule.addDependency(unversionedDependency);
-
-        SimpleModuleDescriptorProvider provider = new SimpleModuleDescriptorProvider();
-        provider.addModuleDescriptor(dependingModule);
-        provider.addModuleDescriptor(requiredModule);
+        ModuleDefinition dependingModule = createModuleDefinition(
+                "dependency.declaring.module");
 
-        buildFrameworkRegistry(provider);
-    }
-
-    public void testVersionMismatch() throws Exception
-    {
-        ModuleDescriptor dependingModule = createModuleDescriptor(
-                "dependency.declaring.module",
-                null);
-
-        ModuleDescriptor requiredModuleOfWrongVersion = createModuleDescriptor(
-                "required.module",
-                "1.0.1");
-
-        DependencyDescriptor dependency = createDependencyDescriptor("required.module", "1.0.0");
-        dependingModule.addDependency(dependency);
-
-        SimpleModuleDescriptorProvider provider = new SimpleModuleDescriptorProvider();
-        provider.addModuleDescriptor(dependingModule);
-        provider.addModuleDescriptor(requiredModuleOfWrongVersion);
-
-        interceptLogging();
-
-        buildFrameworkRegistry(provider);
+        ModuleDefinition requiredModule = createModuleDefinition("required.module");
+        
+        dependingModule.addDependency(requiredModule.getId());
 
-        assertLoggedMessage("Version of required module required.module does not match expected version 1.0.0.");
+        buildFrameworkRegistry(new ModuleDefinition[] {dependingModule, requiredModule});
     }
 
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java Sun Jun 18 14:56:39 2006
@@ -15,13 +15,11 @@
 package hivemind.test;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.SymbolSource;
-import org.apache.hivemind.impl.ContributionImpl;
 import org.apache.hivemind.impl.CreateClassServiceConstructor;
 import org.apache.hivemind.impl.InvokeFactoryServiceConstructor;
 import org.apache.hivemind.impl.ModuleImpl;
@@ -62,40 +60,30 @@
         assertSame(re, ex.getRootCause());
     }
 
-    public void testExtensionImplGetElementsEmpty()
-    {
-        ContributionImpl e = new ContributionImpl();
-
-        assertSame(Collections.EMPTY_LIST, e.getElements());
-    }
-
     public void testInvokeFactoryServiceConstructorAccessors()
     {
-        Module m = new ModuleImpl();
-        ServicePoint sep = new ServicePointImpl();
+        String moduleId = "module";
         List p = new ArrayList();
         InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor();
 
-        c.setContributingModule(m);
-        c.setServiceExtensionPoint(sep);
+        c.setContributingModuleId(moduleId);
         c.setParameters(p);
 
-        assertSame(m, c.getContributingModule());
-        assertSame(sep, c.getServiceExtensionPoint());
+        assertSame(moduleId, c.getContributingModuleId());
         assertSame(p, c.getParameters());
     }
 
     public void testCreateClassServiceConstructorAccessors()
     {
-        Module m = (Module) newMock(Module.class);
+        String moduleId = "module";
 
         replayControls();
 
         CreateClassServiceConstructor c = new CreateClassServiceConstructor();
 
-        c.setContributingModule(m);
+        c.setContributingModuleId(moduleId);
 
-        assertSame(m, c.getContributingModule());
+        assertSame(moduleId, c.getContributingModuleId());
 
         c.setInstanceClassName("java.util.HashMap");
 
@@ -106,18 +94,22 @@
 
     public void testCreateClassServiceConstructorTwice()
     {
+        String moduleId = "module";
+        
+        ServicePoint sp = new ServicePointImpl();
+        
         Module m = newModule();
 
         replayControls();
 
         CreateClassServiceConstructor c = new CreateClassServiceConstructor();
 
-        c.setContributingModule(m);
+        c.setContributingModuleId(moduleId);
 
         c.setInstanceClassName("java.util.HashMap");
 
-        Object o1 = c.constructCoreServiceImplementation();
-        Object o2 = c.constructCoreServiceImplementation();
+        Object o1 = c.constructCoreServiceImplementation(sp, m);
+        Object o2 = c.constructCoreServiceImplementation(sp, m);
 
         assertNotSame(o1, o2);
 
@@ -129,32 +121,40 @@
 
     public void testCreateInstanceWithInitializer()
     {
+        String moduleId = "module";
+        
         Module m = newModule();
-
+        
+        ServicePoint sp = new ServicePointImpl();
+        
         CreateClassServiceConstructor c = new CreateClassServiceConstructor();
 
-        c.setContributingModule(m);
+        c.setContributingModuleId(moduleId);
 
         c.setInstanceClassName(SimpleBean.class.getName() + ",value=HiveMind");
 
-        SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation();
+        SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation(sp, m);
 
         assertEquals("HiveMind", b.getValue());
     }
 
     public void testCreateClassServiceConstructorFailure()
     {
+        String moduleId = "module";
+
         Module m = newModule();
+        
+        ServicePoint sp = new ServicePointImpl();
 
         CreateClassServiceConstructor c = new CreateClassServiceConstructor();
 
-        c.setContributingModule(m);
+        c.setContributingModuleId(moduleId);
 
         c.setInstanceClassName(PrivateBean.class.getName());
 
         try
         {
-            c.constructCoreServiceImplementation();
+            c.constructCoreServiceImplementation(sp, m);
             unreachable();
         }
         catch (Exception ex)

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=415203&r1=415202&r2=415203&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 Sun Jun 18 14:56:39 2006
@@ -88,8 +88,8 @@
     {
         String duplicateModuleId = "non.unique.module";
 
-        ModuleDefinition firstModule = createModuleDefinition(duplicateModuleId, null);
-        ModuleDefinition duplicateModule = createModuleDefinition(duplicateModuleId, null);
+        ModuleDefinition firstModule = createModuleDefinition(duplicateModuleId);
+        ModuleDefinition duplicateModule = createModuleDefinition(duplicateModuleId);
 
         interceptLogging();
 
@@ -100,7 +100,7 @@
 
     public void testDuplicateExtensionPoints() throws Exception
     {
-        ModuleDefinition testModule = createModuleDefinition("hivemind.test", null);
+        ModuleDefinition testModule = createModuleDefinition("hivemind.test");
 
         testModule.addServicePoint(createServicePointDefinition("MyService", Comparable.class));
         testModule.addServicePoint(createServicePointDefinition("MyService", Comparable.class));

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java Sun Jun 18 14:56:39 2006
@@ -14,8 +14,11 @@
 
 package hivemind.test;
 
-import org.apache.hivemind.Registry;
 import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.Registry;
+import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
+import org.apache.hivemind.definition.ServicePointDefinition;
 
 /**
  * Tests the Registry.getService(java.lang.Class) functionality.
@@ -30,7 +33,26 @@
     {
     	super.setUp();
     	
-        registry = buildFrameworkRegistry("servicesByInterface.xml");
+        ModuleDefinition module = createModuleDefinition("hivemind.tests.serviceByInterface");
+
+        ServicePointDefinition sp1 = createServicePointDefinition("uniqueService", IUniqueService.class);
+        ServiceImplementationDefinition impl1 = createServiceImplementationDefinition(UniqueServiceImpl.class);
+        sp1.addImplementation(impl1);
+
+        module.addServicePoint(sp1);
+
+        ServicePointDefinition sp2 = createServicePointDefinition("multipleServiceOne", IMultipleService.class);
+        ServiceImplementationDefinition impl2 = createServiceImplementationDefinition(MultipleServiceImpl.class);
+        sp2.addImplementation(impl2);
+
+        module.addServicePoint(sp2);
+
+        ServicePointDefinition sp3 = createServicePointDefinition("multipleServiceTwo", IMultipleService.class);
+        sp3.addImplementation(impl2);
+        
+        module.addServicePoint(sp3);
+
+        registry = buildFrameworkRegistry(module);
     }
 
     protected void tearDown() throws Exception
@@ -74,8 +96,8 @@
             assertExceptionSubstring(
                 ex,
                 "There are multiple service points for interface hivemind.test.IMultipleService: "
-                    + "{hivemind.tests.serviceByInterface.multipleServiceOne,"
-                    + " hivemind.tests.serviceByInterface.multipleServiceTwo}.");
+                    + "{hivemind.tests.serviceByInterface.multipleServiceTwo,"
+                    + " hivemind.tests.serviceByInterface.multipleServiceOne}.");
         }
     }
 }

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/CountFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/CountFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/CountFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/CountFactory.java Sun Jun 18 14:56:39 2006
@@ -18,7 +18,6 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.util.List;
 
 import org.apache.hivemind.InterceptorStack;
 import org.apache.hivemind.ServiceInterceptorFactory;
@@ -74,7 +73,7 @@
 
     }
 
-    public void createInterceptor(InterceptorStack stack, Module invokingModule, List parameters)
+    public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters)
     {
         InvocationHandler countHandler = new CountHandler(stack.peek());
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/TrackerFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/TrackerFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/TrackerFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/impl/TrackerFactory.java Sun Jun 18 14:56:39 2006
@@ -72,7 +72,7 @@
     public void createInterceptor(
         InterceptorStack stack,
         Module contributingModule,
-        List parameters)
+        Object parameters)
     {
         Class interfaceClass = stack.getServiceInterface();
         ClassLoader loader = contributingModule.getClassResolver().getClassLoader();

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java Sun Jun 18 14:56:39 2006
@@ -184,7 +184,7 @@
         cpc.setReturnValue( "hivemind.ServiceModels" );
         cp.visibleToModule( null );
         cpc.setReturnValue( true );
-        cp.getElements();
+        cp.getContainer();
         cpc.setReturnValue( Collections.EMPTY_LIST );
         replayControls();
         RegistryInfrastructureImpl r = new RegistryInfrastructureImpl( null, null );

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java Sun Jun 18 14:56:39 2006
@@ -45,7 +45,7 @@
 {
     public void testFound()
     {
-        SchemaImpl schema = new SchemaImpl();
+        SchemaImpl schema = new SchemaImpl("module");
         schema.setId("Baz");
 
         DefaultErrorHandler errorHandler = new DefaultErrorHandler();
@@ -83,7 +83,7 @@
 
         Log log = LogFactory.getLog(TestRegistryInfrastructureConstructor.class);
 
-        SchemaImpl schema = new SchemaImpl();
+        SchemaImpl schema = new SchemaImpl("module");
         schema.setId("Baz");
         schema.setVisibility(Visibility.PRIVATE);
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestVisibility.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestVisibility.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestVisibility.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestVisibility.java Sun Jun 18 14:56:39 2006
@@ -281,8 +281,6 @@
         MockControl ehc = newControl(ErrorHandler.class);
         ErrorHandler errorHandler = (ErrorHandler) ehc.getMock();
 
-        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl();
-
         XmlResourceProcessor parser = new XmlResourceProcessor(getClassResolver(), errorHandler);
 
         RegistryInfrastructureConstructor cons = new RegistryInfrastructureConstructor(
@@ -301,8 +299,6 @@
         InterceptorDescriptor itd = (InterceptorDescriptor) id.getInterceptors().get(0);
 
         cons.addModuleDescriptor(md);
-
-        assembly.performPostProcessing();
 
         // Training
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestObjectProviders.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestObjectProviders.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestObjectProviders.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestObjectProviders.java Sun Jun 18 14:56:39 2006
@@ -18,9 +18,7 @@
 import hivemind.test.services.impl.StringHolderImpl;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.Location;
@@ -72,7 +70,6 @@
         ConfigurationObjectProvider p = new ConfigurationObjectProvider();
 
         List expectedList = new ArrayList();
-        Map expectedMap = new HashMap();
 
         MockControl mc = newControl(Module.class);
         Module m = (Module) mc.getMock();
@@ -80,21 +77,11 @@
         m.getConfiguration("barney");
         mc.setReturnValue(expectedList);
 
-        m.isConfigurationMappable("barney");
-        mc.setReturnValue(true);
-
-        m.getConfigurationAsMap("barney");
-        mc.setReturnValue(expectedMap);
-
         replayControls();
 
         Object actual = p.provideObject(m, List.class, "barney", null);
 
         assertSame(expectedList, actual);
-
-        actual = p.provideObject(m, Map.class, "barney", null);
-
-        assertSame(expectedMap, actual);
 
         verifyControls();
     }

Modified: jakarta/hivemind/branches/branch-2-0-annot/jmx/src/descriptor/META-INF/jmx-connector-module.xml
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/jmx/src/descriptor/META-INF/jmx-connector-module.xml?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/jmx/src/descriptor/META-INF/jmx-connector-module.xml (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/jmx/src/descriptor/META-INF/jmx-connector-module.xml Sun Jun 18 14:56:39 2006
@@ -20,14 +20,14 @@
   <service-point id="JMXConnectorServerFactory" interface="org.apache.hivemind.ServiceImplementationFactory" >
     Used to construct JMXConnectorServer instances (interface JMXConnectorServerMBean).
     These instances provide jmx remote management capabilities.
-    <parameters-schema>
+    <parameters-schema >
       <element name="connector">
         Specifies parameters needed to construct the JMXConnectorServer.
         <attribute name="jmx-service-url" required="true">
         The address of a JMX API connector server. Syntax corresponds to javax.management.remote.JMXServiceURL
         </attribute>
         <conversion class="org.apache.hivemind.management.impl.JMXConnectorServerParameter">
-        <map attribute="jmx-service-url" property="jmxServiceURL"/>
+					<map attribute="jmx-service-url" property="jmxServiceURL"/>
         </conversion>
       </element>
     </parameters-schema>

Modified: jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/JMXConnectorServerFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/JMXConnectorServerFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/JMXConnectorServerFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/JMXConnectorServerFactory.java Sun Jun 18 14:56:39 2006
@@ -15,6 +15,7 @@
 package org.apache.hivemind.management.impl;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.management.MBeanServer;
@@ -43,8 +44,8 @@
             ServiceImplementationFactoryParameters factoryParameters)
     {
         // Read the parameters of the factory call
-        JMXConnectorServerParameter parameter = (JMXConnectorServerParameter) factoryParameters
-                .getFirstParameter();
+        List parameterList = (List) factoryParameters.getParameters();
+        JMXConnectorServerParameter parameter = (JMXConnectorServerParameter) parameterList.get(0);
 
         Map env = new HashMap();
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/PerformanceMonitorFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/PerformanceMonitorFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/PerformanceMonitorFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/jmx/src/java/org/apache/hivemind/management/impl/PerformanceMonitorFactory.java Sun Jun 18 14:56:39 2006
@@ -117,11 +117,11 @@
 
     }
 
-    public void createInterceptor(InterceptorStack stack, Module invokingModule, List parameters)
+    public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters)
     {
         ServicePoint servicePoint = invokingModule.getServicePoint(stack
                 .getServiceExtensionPointId());
-        Set methods = getInterceptedMethods(stack, parameters);
+        Set methods = getInterceptedMethods(stack, (List) parameters); 
         try
         {
             PerformanceCollector counter = createMBean(servicePoint, methods);

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java Sun Jun 18 14:56:39 2006
@@ -35,7 +35,7 @@
     public Object createCoreServiceImplementation(
             ServiceImplementationFactoryParameters factoryParameters)
     {
-        List contributions = (List) factoryParameters.getFirstParameter();
+        List contributions = (List) factoryParameters.getParameters();
 
         Orderer orderer = new Orderer(factoryParameters.getErrorLog(), "command");
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/factory/BeanFactoryBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/factory/BeanFactoryBuilder.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/factory/BeanFactoryBuilder.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/factory/BeanFactoryBuilder.java Sun Jun 18 14:56:39 2006
@@ -28,7 +28,7 @@
     public Object createCoreServiceImplementation(
             ServiceImplementationFactoryParameters factoryParameters)
     {
-        BeanFactoryParameter p = (BeanFactoryParameter) factoryParameters.getParameters().get(0);
+        BeanFactoryParameter p = (BeanFactoryParameter) factoryParameters.getParameters();
 
         return new BeanFactoryImpl(factoryParameters.getErrorLog(), p.getVendClass(), p
                 .getContributions(), p.getDefaultCacheable());

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/EJBProxyFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/EJBProxyFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/EJBProxyFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/EJBProxyFactory.java Sun Jun 18 14:56:39 2006
@@ -51,7 +51,7 @@
 
     public Object createCoreServiceImplementation(ServiceImplementationFactoryParameters factoryParameters)
     {
-        EJBProxyParameters proxyParameters = (EJBProxyParameters) factoryParameters.getParameters().get(0);
+        EJBProxyParameters proxyParameters = (EJBProxyParameters) factoryParameters.getFirstParameter();
         String jndiName = proxyParameters.getJndiName();
         String homeInterfaceClassName = proxyParameters.getHomeInterfaceClassName();
 

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java Sun Jun 18 14:56:39 2006
@@ -42,11 +42,11 @@
      * 
      * @see org.apache.hivemind.ServiceInterceptorFactory#createInterceptor(org.apache.hivemind.InterceptorStack, org.apache.hivemind.internal.Module, java.util.List)
      */
-    public void createInterceptor(InterceptorStack stack, Module invokingModule, List parameters)
+    public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters)
     {
         final Class[] interfaces = new Class[]{stack.getServiceInterface()};
         final ClassLoader classLoader = invokingModule.getClassResolver().getClassLoader();
-        final Object parameter = parameters.get( 0 );
+        final Object parameter = ((List) parameters).get( 0 ); 
         Defense.isAssignable( parameter, MethodInterceptor.class, "Implementation Object" );
         MethodInterceptor methodInterceptor = ( MethodInterceptor )parameter;
         final InvocationHandler invocationHandler = new MethodInterceptorInvocationHandler( methodInterceptor, stack );

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/ServicePropertyFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/ServicePropertyFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/ServicePropertyFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/ServicePropertyFactory.java Sun Jun 18 14:56:39 2006
@@ -45,7 +45,7 @@
             ServiceImplementationFactoryParameters factoryParameters)
     {
         ServicePropertyFactoryParameter p = (ServicePropertyFactoryParameter) factoryParameters
-                .getParameters().get(0);
+                .getFirstParameter();
 
         ServicePoint targetServicePoint = p.getServicePoint();
         final Class targetServiceInterface = targetServicePoint.getServiceInterface();

Modified: jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/pipeline/PipelineFactory.java
URL: http://svn.apache.org/viewvc/jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/pipeline/PipelineFactory.java?rev=415203&r1=415202&r2=415203&view=diff
==============================================================================
--- jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/pipeline/PipelineFactory.java (original)
+++ jakarta/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/pipeline/PipelineFactory.java Sun Jun 18 14:56:39 2006
@@ -41,7 +41,7 @@
     public Object createCoreServiceImplementation(
             ServiceImplementationFactoryParameters factoryParameters)
     {
-        PipelineParameters pp = (PipelineParameters) factoryParameters.getParameters().get(0);
+        PipelineParameters pp = (PipelineParameters) factoryParameters.getFirstParameter();
 
         PipelineAssembler pa = new PipelineAssembler(_errorLog, factoryParameters.getServiceId(),
                 factoryParameters.getServiceInterface(), pp.getFilterInterface(), _classFactory,



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