You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by jo...@apache.org on 2011/03/24 05:09:26 UTC

svn commit: r1084837 - in /cxf/sandbox/cxf-blueprint: core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java jaxws/src/main/resources/jaxws.xsd

Author: joed
Date: Thu Mar 24 04:09:25 2011
New Revision: 1084837

URL: http://svn.apache.org/viewvc?rev=1084837&view=rev
Log:
Schema cleanups

Modified:
    cxf/sandbox/cxf-blueprint/core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java
    cxf/sandbox/cxf-blueprint/jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java
    cxf/sandbox/cxf-blueprint/jaxws/src/main/resources/jaxws.xsd

Modified: cxf/sandbox/cxf-blueprint/core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/cxf-blueprint/core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java?rev=1084837&r1=1084836&r2=1084837&view=diff
==============================================================================
--- cxf/sandbox/cxf-blueprint/core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java (original)
+++ cxf/sandbox/cxf-blueprint/core/src/main/java/org/apache/cxf/blueprint/core/BaseCxfParser.java Thu Mar 24 04:09:25 2011
@@ -28,7 +28,6 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import org.apache.aries.blueprint.ComponentDefinitionRegistry;
-import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.aries.blueprint.ParserContext;
 import org.apache.aries.blueprint.PassThroughMetadata;
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
@@ -53,6 +52,8 @@ public abstract class BaseCxfParser {
 
     private static final transient Logger LOG = LoggerFactory.getLogger(BaseCxfParser.class);
     private static final String WIRE_BUS_ATTRIBUTE = BaseCxfParser.class.getName() + ".wireBus";
+    private static final String XMLNS_BLUEPRINT = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
+    protected static final String COMPONENT_ID = "component-id";
 
     protected boolean hasBusProperty() {
         return false;
@@ -119,14 +120,13 @@ public abstract class BaseCxfParser {
             throw new IllegalStateException(propertyName + " property must have child elements!");
         }
 
-        Metadata child;
         String id;
-        if (first.getNamespaceURI().equals("http://www.osgi.org/xmlns/blueprint/v1.0.0")) {
+        if (first.getNamespaceURI().equals(XMLNS_BLUEPRINT)) {
             String name = first.getLocalName();
             if ("ref".equals(name)) {
-                id = first.getAttribute("bean");
+                id = first.getAttribute(COMPONENT_ID);
                 if (id == null) {
-                    throw new IllegalStateException("<ref> elements must have a \"bean\" attribute!");
+                    throw new IllegalStateException("<ref> elements must have a \"component-id\" attribute!");
                 }
                 Object o = ctx.parseElement(RefMetadata.class, ctx.getEnclosingComponent(), first);
                 LOG.debug("ref object " + o);
@@ -142,21 +142,10 @@ public abstract class BaseCxfParser {
                         "Elements with the name " + name + " are not currently " + "supported as sub elements of " + element.getLocalName());
                 }
             }
+        } else {
+            throw new UnsupportedOperationException(
+                "Elements with the name " + first.getLocalName() + " are not currently " + "supported as sub elements of " + element.getLocalName());
         }
-
-        //TODO check the parsing, this will require a chained NSHandler.
-        //i.e a service lookup, etc etc. in a blueprint world it does not make a ton of sense.
-        child = parseCustomElement(element, ctx);
-        bean.addProperty(propertyName, child);
-    }
-
-    private static Metadata parseCustomElement(Element ele, ParserContext ctx) {
-        String namespaceUri = ele.getNamespaceURI();
-        NamespaceHandler handler = null;
-        if (handler == null) {
-            return null;
-        }
-        return null;
     }
 
     QName parseQName(Element element, String t) {

Modified: cxf/sandbox/cxf-blueprint/jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/cxf-blueprint/jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java?rev=1084837&r1=1084836&r2=1084837&view=diff
==============================================================================
--- cxf/sandbox/cxf-blueprint/jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java (original)
+++ cxf/sandbox/cxf-blueprint/jaxws/src/main/java/org/apache/cxf/blueprint/jaxws/EndpointDefinitionParser.java Thu Mar 24 04:09:25 2011
@@ -77,7 +77,6 @@ class EndpointDefinitionParser extends B
                 implClass.setId(".cxf.endpoint.implementationClass." + implId);
                 implClass.setClassName(implementationClass);
                 context.getComponentDefinitionRegistry().registerComponentDefinition(implClass);
-
                 cxfBean.addArgument(NSUtils.createRef(context, implId), Object.class.getName(), 0);
             } else {
                 //Use the default bus or create it if this is the first run through the parser.
@@ -122,9 +121,10 @@ class EndpointDefinitionParser extends B
                 implClass.setId("cxf.endpoint.implementationClass." + implId);
                 implClass.setClassName(implementationClass);
                 context.getComponentDefinitionRegistry().registerComponentDefinition(implClass);
-
+                //TODO - FIX THIS, There is an NPE here.
                 cxfBean.addArgument(NSUtils.createRef(context, implId), Object.class.getName(), 1);
             }
+
             cxfBean.addArgument(NSUtils.createRef(context, bus), Bus.class.getName(), 0);
         }
 

Modified: cxf/sandbox/cxf-blueprint/jaxws/src/main/resources/jaxws.xsd
URL: http://svn.apache.org/viewvc/cxf/sandbox/cxf-blueprint/jaxws/src/main/resources/jaxws.xsd?rev=1084837&r1=1084836&r2=1084837&view=diff
==============================================================================
--- cxf/sandbox/cxf-blueprint/jaxws/src/main/resources/jaxws.xsd (original)
+++ cxf/sandbox/cxf-blueprint/jaxws/src/main/resources/jaxws.xsd Thu Mar 24 04:09:25 2011
@@ -26,6 +26,7 @@
             jaxb:version="2.0"
             elementFormDefault="qualified">
 
+  <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0" schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"/>
   <xsd:import namespace="http://cxf.apache.org/configuration/beans" schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
 
   <xsd:complexType name="identifiedType" abstract="true">