geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r765000 - in /geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint: context/Parser.java reflect/LocalComponentMetadataImpl.java reflect/ServiceExportComponentMetadataImpl.java
Date Tue, 14 Apr 2009 23:29:05 GMT
Author: gawor
Date: Tue Apr 14 23:29:04 2009
New Revision: 765000

URL: http://svn.apache.org/viewvc?rev=765000&view=rev
Log:
fix depends-on handling

Modified:
    geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
    geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/LocalComponentMetadataImpl.java
    geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/ServiceExportComponentMetadataImpl.java

Modified: geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java?rev=765000&r1=764999&r2=765000&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
(original)
+++ geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
Tue Apr 14 23:29:04 2009
@@ -361,7 +361,7 @@
             throw new ComponentDefinitionException("Attribute " + LAZY_INIT_ATTRIBUTE + "
must be equals to " + BOOLEAN_DEFAULT + ", " + BOOLEAN_TRUE + " or " + BOOLEAN_FALSE);
         }
         if (element.hasAttribute(DEPENDS_ON_ATTRIBUTE)) {
-            metadata.setDependsOn(element.getAttribute(DEPENDS_ON_ATTRIBUTE));
+            metadata.setExplicitDependencies(parseListAsSet(element.getAttribute(DEPENDS_ON_ATTRIBUTE)));
         }
         if (element.hasAttribute(INIT_METHOD_ATTRIBUTE)) {
             metadata.setInitMethodName(element.getAttribute(INIT_METHOD_ATTRIBUTE));
@@ -419,7 +419,7 @@
             service.setExportedComponent(new ReferenceValueImpl(element.getAttribute(REF_ATTRIBUTE)));
         }
         if (element.hasAttribute(DEPENDS_ON_ATTRIBUTE)) {
-            service.setDependsOn(element.getAttribute(DEPENDS_ON_ATTRIBUTE));
+            service.setExplicitDependencies(parseListAsSet(element.getAttribute(DEPENDS_ON_ATTRIBUTE)));
         }
         String autoExport = element.hasAttribute(AUTO_EXPORT_ATTRIBUTE) ? element.getAttribute(AUTO_EXPORT_ATTRIBUTE)
: AUTO_EXPORT_DEFAULT;
         if (AUTO_EXPORT_DISABLED.equals(autoExport)) {
@@ -972,6 +972,18 @@
         return (name.equals(node.getNodeName()) || name.equals(node.getLocalName()));
     }
 
+    private static Set<String> parseListAsSet(String list) {
+        String[] items = list.split(",");
+        Set<String> set = new HashSet<String>();
+        for (String item : items) {
+            item = item.trim();
+            if (item.length() > 0) {
+                set.add(item);
+            }
+        }
+        return set;                   
+    }
+
     private static String getTextValue(Element element) {
         StringBuffer value = new StringBuffer();
         NodeList nl = element.getChildNodes();

Modified: geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/LocalComponentMetadataImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/LocalComponentMetadataImpl.java?rev=765000&r1=764999&r2=765000&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/LocalComponentMetadataImpl.java
(original)
+++ geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/LocalComponentMetadataImpl.java
Tue Apr 14 23:29:04 2009
@@ -18,18 +18,16 @@
  */
 package org.apache.felix.blueprint.reflect;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.HashSet;
 
 import org.osgi.service.blueprint.reflect.ConstructorInjectionMetadata;
 import org.osgi.service.blueprint.reflect.LocalComponentMetadata;
 import org.osgi.service.blueprint.reflect.MethodInjectionMetadata;
+import org.osgi.service.blueprint.reflect.ParameterSpecification;
 import org.osgi.service.blueprint.reflect.PropertyInjectionMetadata;
 import org.osgi.service.blueprint.reflect.Value;
-import org.osgi.service.blueprint.reflect.ParameterSpecification;
 
 /**
  * TODO: javadoc
@@ -63,17 +61,6 @@
         this.className = className;
     }
 
-    public void setDependsOn(String dependsOn) {
-        Set<String> set = new HashSet<String>();
-        for (String dep : dependsOn.split(",")) {
-            dep = dep.trim();
-            if (dep.length() > 0) {
-                set.add(dep);
-            }
-        }
-        setExplicitDependencies(set);
-    }
-
     public String getInitMethodName() {
         return initMethodName;
     }

Modified: geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/ServiceExportComponentMetadataImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/ServiceExportComponentMetadataImpl.java?rev=765000&r1=764999&r2=765000&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/ServiceExportComponentMetadataImpl.java
(original)
+++ geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/reflect/ServiceExportComponentMetadataImpl.java
Tue Apr 14 23:29:04 2009
@@ -44,7 +44,6 @@
     private MapValue servicePropertiesValue;
     private int ranking;
     private Collection<RegistrationListenerMetadata> registrationListeners;
-    private String dependsOn;
 
     public Value getExportedComponent() {
         return exportedComponent;
@@ -70,14 +69,6 @@
         this.autoExportMode = autoExportMode;
     }
 
-    public String getDependsOn() {
-        return dependsOn;
-    }
-
-    public void setDependsOn(String dependsOn) {
-        this.dependsOn = dependsOn;
-    }
-
     public Map getServiceProperties() {
         return serviceProperties;
     }



Mime
View raw message