geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r770780 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context: BlueprintContextImpl.java BlueprintObjectRecipe.java Parser.java
Date Fri, 01 May 2009 18:16:19 GMT
Author: gawor
Date: Fri May  1 18:16:18 2009
New Revision: 770780

URL: http://svn.apache.org/viewvc?rev=770780&view=rev
Log:
parse reference, service, ref-list, ref-set inner components

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java?rev=770780&r1=770779&r2=770780&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
Fri May  1 18:16:18 2009
@@ -398,14 +398,15 @@
     }
     
     public Object getComponent(String name) throws NoSuchComponentException {
-        ComponentMetadata metadata = getComponentMetadata(name);
-        if (metadata == null) {
+        if (objectGraph == null) {
             throw new NoSuchComponentException(name);
         }
-        if (objectGraph == null) {
-            return null;
+        Object instance = objectGraph.create(name);
+        if (instance == null) {
+            throw new NoSuchComponentException(name);
+        } else {
+            return instance;
         }
-        return objectGraph.create(name);
     }
 
     public ComponentMetadata getComponentMetadata(String name) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java?rev=770780&r1=770779&r2=770780&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
Fri May  1 18:16:18 2009
@@ -40,6 +40,7 @@
 import org.osgi.service.blueprint.reflect.CollectionMetadata;
 import org.osgi.service.blueprint.reflect.MapMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.PropsMetadata;
 import org.osgi.service.blueprint.reflect.ValueMetadata;
 
 /**
@@ -172,6 +173,8 @@
             return false;
         } else if (metadata instanceof CollectionMetadata) {
             return false;
+        } else if (metadata instanceof PropsMetadata) {
+            return false;
         }
         return true;
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java?rev=770780&r1=770779&r2=770780&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
Fri May  1 18:16:18 2009
@@ -664,8 +664,7 @@
             value = getTextValue(element);
         }
         String key = element.getAttribute(KEY_ATTRIBUTE);
-        return new MapEntryImpl(new ValueMetadataImpl(key, String.class.getName()),
-                                new ValueMetadataImpl(value, String.class.getName()));
+        return new MapEntryImpl(new ValueMetadataImpl(key), new ValueMetadataImpl(value));
     }
 
     public MapMetadata parseMap(Element element, ComponentMetadata enclosingComponent) {
@@ -1023,6 +1022,14 @@
         if (isBlueprintNamespace(element.getNamespaceURI())) {
             if (nodeNameEquals(element, BEAN_ELEMENT)) {
                 return parseBeanMetadata(element);
+            } else if (nodeNameEquals(element, REFERENCE_ELEMENT)) {
+                return parseReference(element);
+            } else if (nodeNameEquals(element, SERVICE_ELEMENT)) {
+                return parseService(element);
+            } else if (nodeNameEquals(element, REFLIST_ELEMENT) ) {
+                return parseRefCollection(element, List.class);
+            } else if (nodeNameEquals(element, REFSET_ELEMENT)) {
+                return parseRefCollection(element, Set.class);
             } else if (nodeNameEquals(element, NULL_ELEMENT) && allowNull) {
                 return NullMetadata.NULL;
             } else if (nodeNameEquals(element, VALUE_ELEMENT)) {



Mime
View raw message