hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r470091 - in /hivemind/branches/branch-2-0-annot/annotations/src: java/org/apache/hivemind/annotations/ java/org/apache/hivemind/annotations/internal/ test/org/apache/hivemind/annotations/
Date Wed, 01 Nov 2006 20:39:49 GMT
Author: ahuegen
Date: Wed Nov  1 12:39:49 2006
New Revision: 470091

URL: http://svn.apache.org/viewvc?view=rev&rev=470091
Log:
Used varargs instead of arrays for module classes

Modified:
    hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/AnnotatedRegistryBuilder.java
    hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/Registry.java
    hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/internal/RegistryImpl.java
    hivemind/branches/branch-2-0-annot/annotations/src/test/org/apache/hivemind/annotations/AnnotationTestCase.java

Modified: hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/AnnotatedRegistryBuilder.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/AnnotatedRegistryBuilder.java?view=diff&rev=470091&r1=470090&r2=470091
==============================================================================
--- hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/AnnotatedRegistryBuilder.java
(original)
+++ hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/AnnotatedRegistryBuilder.java
Wed Nov  1 12:39:49 2006
@@ -36,29 +36,19 @@
         
     }
     
-    public Registry constructRegistry(String moduleClassName)
-    {
-        return constructRegistry(new String[] {moduleClassName});
-    }
-
-    public Registry constructRegistry(String[] moduleClassNames)
+    public Registry constructRegistry(String ... moduleClassNames)
     {
         RegistryDefinition definition = constructRegistryDefinition(moduleClassNames);
         return RegistryBuilder.constructRegistry(definition, _errorHandler, _locale);
     }
     
-    public Registry constructRegistry(Class moduleClass)
-    {
-        return constructRegistry(new Class[] {moduleClass});
-    }
-
-    public Registry constructRegistry(Class[] moduleClasses)
+    public Registry constructRegistry(Class ... moduleClasses)
     {
         RegistryDefinition definition = constructRegistryDefinition(moduleClasses);
         return RegistryBuilder.constructRegistry(definition, _errorHandler, _locale);
     }
     
-    private RegistryDefinition constructRegistryDefinition(String[] moduleClassNames)
+    private RegistryDefinition constructRegistryDefinition(String ... moduleClassNames)
     {
         RegistryDefinition definition = new RegistryDefinition();
 
@@ -72,7 +62,7 @@
         return definition;
     }
     
-    private RegistryDefinition constructRegistryDefinition(Class[] moduleClasses)
+    private RegistryDefinition constructRegistryDefinition(Class ... moduleClasses)
     {
         RegistryDefinition definition = new RegistryDefinition();
 

Modified: hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/Registry.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/Registry.java?view=diff&rev=470091&r1=470090&r2=470091
==============================================================================
--- hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/Registry.java
(original)
+++ hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/Registry.java
Wed Nov  1 12:39:49 2006
@@ -1,5 +1,6 @@
 package org.apache.hivemind.annotations;
 
+import org.apache.hivemind.SymbolSource;
 import org.apache.hivemind.service.Autowiring;
 
 /**
@@ -8,7 +9,7 @@
  * 
  * @author Achim Huegen
  */
-public interface Registry
+public interface Registry extends SymbolSource
 {
     public <T> T getService(String serviceId, Class<T> serviceInterface);
     public <T> T getService(Class<T> serviceInterface);

Modified: hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/internal/RegistryImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/internal/RegistryImpl.java?view=diff&rev=470091&r1=470090&r2=470091
==============================================================================
--- hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/internal/RegistryImpl.java
(original)
+++ hivemind/branches/branch-2-0-annot/annotations/src/java/org/apache/hivemind/annotations/internal/RegistryImpl.java
Wed Nov  1 12:39:49 2006
@@ -64,4 +64,12 @@
         return getService(Autowiring.class);
     }
 
+    /**
+     * @see org.apache.hivemind.SymbolSource#valueForSymbol(java.lang.String)
+     */
+    public String valueForSymbol(String name)
+    {
+        return _delegate.valueForSymbol(name);
+    }
+
 }

Modified: hivemind/branches/branch-2-0-annot/annotations/src/test/org/apache/hivemind/annotations/AnnotationTestCase.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/annotations/src/test/org/apache/hivemind/annotations/AnnotationTestCase.java?view=diff&rev=470091&r1=470090&r2=470091
==============================================================================
--- hivemind/branches/branch-2-0-annot/annotations/src/test/org/apache/hivemind/annotations/AnnotationTestCase.java
(original)
+++ hivemind/branches/branch-2-0-annot/annotations/src/test/org/apache/hivemind/annotations/AnnotationTestCase.java
Wed Nov  1 12:39:49 2006
@@ -9,36 +9,19 @@
 
 public class AnnotationTestCase extends HiveMindTestCase
 {
-    protected Registry constructRegistry(String[] moduleClassNames)
+    protected Registry constructRegistry(String ... moduleClassNames)
     {
         AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
         return builder.constructRegistry(moduleClassNames);
     }
 
-    protected Registry constructRegistry(String moduleClassName)
-    {
-        AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
-        return builder.constructRegistry(moduleClassName);
-    }
-
-    protected Registry constructRegistry(Class[] moduleClasses)
+    protected Registry constructRegistry(Class ... moduleClasses)
     {
         AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
         return builder.constructRegistry(moduleClasses);
     }
 
-    protected Registry constructRegistry(Class moduleClass)
-    {
-        AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
-        return builder.constructRegistry(moduleClass);
-    }
-
-    protected RegistryDefinition constructRegistryDefinition(Class moduleClass)
-    {
-        return constructRegistryDefinition(new Class[] {moduleClass});
-    }
-    
-    protected RegistryDefinition constructRegistryDefinition(Class[] moduleClasses)
+    protected RegistryDefinition constructRegistryDefinition(Class ... moduleClasses)
     {
         RegistryDefinition definition = new RegistryDefinition();
 



Mime
View raw message