You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/03/31 06:12:31 UTC

svn commit: r1087182 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/configuration/blueprint/ core/src/main/java/org/apache/cxf/databinding/source/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ frontend/jaxws/src/main/java/org/apache/cxf/jax...

Author: dkulp
Date: Thu Mar 31 04:12:31 2011
New Revision: 1087182

URL: http://svn.apache.org/viewvc?rev=1087182&view=rev
Log:
Get jaxws:server and simple:server elements working in blueprint
Start stubbing in jaxws:client/simple:client

Added:
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java   (with props)
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java   (with props)
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/SimpleBPNamespaceHandler.java
      - copied, changed from r1087072, cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java
    cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/
    cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/
    cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml   (with props)
    cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/
    cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd   (with props)
Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/SimpleBPBeanDefinitionParser.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java
    cxf/trunk/rt/frontend/simple/pom.xml
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/SimpleBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/SimpleBPBeanDefinitionParser.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/SimpleBPBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/SimpleBPBeanDefinitionParser.java Thu Mar 31 04:12:31 2011
@@ -23,29 +23,64 @@ import org.w3c.dom.Element;
 
 import org.apache.aries.blueprint.ParserContext;
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
 import org.osgi.service.blueprint.reflect.Metadata;
 
 /**
  * 
  */
 public class SimpleBPBeanDefinitionParser extends AbstractBPBeanDefinitionParser {
-    Class<?> cls;
+    protected Class<?> cls;
     
     public SimpleBPBeanDefinitionParser(Class<?> cls) {
         this.cls = cls;
     }
 
-    public String getId(Element element) {
+    public String getFactorySuffix() {
+        return null;
+    }
+    public String getFactoryCreateType(Element element) {
+        return null;
+    }
+    
+    public String getId(Element element, ParserContext context) {
         return element.hasAttribute("id") ? element.getAttribute("id") : null;
     }
     
     public Metadata parse(Element element, ParserContext context) {
         MutableBeanMetadata cxfBean = context.createMetadata(MutableBeanMetadata.class);
         cxfBean.setRuntimeClass(cls);
-        cxfBean.setId(getId(element));
+        String fact = getFactorySuffix();
+        if (fact == null) {
+            cxfBean.setId(getId(element, context));
+        } else {
+            cxfBean.setId(getId(element, context) + fact);            
+        }
         parseAttributes(element, context, cxfBean);
         parseChildElements(element, context, cxfBean);
+        if (hasBusProperty()) {
+            boolean foundBus = false;
+            for (BeanProperty bp : cxfBean.getProperties()) {
+                if ("bus".equals(bp.getName())) {
+                    foundBus = true;
+                }
+            }
+            if (!foundBus) {
+                cxfBean.addProperty("bus", getBusRef(context, "cxf"));
+            }
+        }
+        if (fact != null) {
+            context.getComponentDefinitionRegistry().registerComponentDefinition(cxfBean);
+            
+            MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
+            bean.setId(getId(element, context));
+            bean.setFactoryComponent(cxfBean);
+            bean.setFactoryMethod("create");
+            bean.setClassName(getFactoryCreateType(element));
+            return bean;
+        }
         return cxfBean;
     }
 
+    
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java Thu Mar 31 04:12:31 2011
@@ -28,7 +28,6 @@ import javax.activation.DataSource;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Thu Mar 31 04:12:31 2011
@@ -181,13 +181,13 @@ public class JaxWsServerFactoryBean exte
     
     public Server create() {
         Server server = super.create();
-        init();
+        initializeResourcesAndHandlerChain();
         checkPrivateEndpoint(server.getEndpoint());
         
         return server;
     }
     
-    private synchronized void init() {
+    private synchronized void initializeResourcesAndHandlerChain() {
         if (doInit) {
             try {
                 injectResources(getServiceBean());

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java Thu Mar 31 04:12:31 2011
@@ -71,10 +71,6 @@ class EndpointDefinitionParser extends A
         //Endpoint definition
         MutableBeanMetadata cxfBean = context.createMetadata(MutableBeanMetadata.class);
 
-        //Add a blueprintContainer ref
-
-        //cxfBean.addProperty("blueprintContainer", NSUtils.createRef(context, "blueprintContainer"));
-        //cxfBean.addProperty("bundleContext", NSUtils.createRef(context, "blueprintBundleContext"));
         if (!StringUtils.isEmpty(getIdOrName(element))) {
             cxfBean.setId(getIdOrName(element));
         } else {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java Thu Mar 31 04:12:31 2011
@@ -27,6 +27,10 @@ import org.w3c.dom.Node;
 
 import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.aries.blueprint.ParserContext;
+import org.apache.cxf.frontend.blueprint.ClientProxyFactoryBeanDefinitionParser;
+import org.apache.cxf.frontend.blueprint.ServerFactoryBeanDefinitionParser;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
@@ -50,9 +54,11 @@ public class JAXWSBPNamespaceHandler imp
         if ("endpoint".equals(s)) {
             return new EndpointDefinitionParser().parse(element, context);
         } else if ("server".equals(s)) {
-            //TODO
+            return new ServerFactoryBeanDefinitionParser(JaxWsServerFactoryBean.class)
+                .parse(element, context);
         } else if ("client".equals(s)) {
-            //TODO
+            return new ClientProxyFactoryBeanDefinitionParser(JaxWsProxyFactoryBean.class)
+                .parse(element, context);
         }
         return null;
     }

Modified: cxf/trunk/rt/frontend/simple/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/pom.xml?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/pom.xml (original)
+++ cxf/trunk/rt/frontend/simple/pom.xml Thu Mar 31 04:12:31 2011
@@ -48,7 +48,14 @@
              <artifactId>spring-context</artifactId>
              <optional>true</optional>
          </dependency>
-
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java Thu Mar 31 04:12:31 2011
@@ -187,7 +187,29 @@ public class ServerFactoryBean extends A
         }
         return server;
     }
-
+    public void init() {
+        if (getServer() == null) {
+            ClassLoader orig = Thread.currentThread().getContextClassLoader();
+            try {
+                if (bus != null) {
+                    ClassLoader loader = bus.getExtension(ClassLoader.class);
+                    if (loader != null) {
+                        Thread.currentThread().setContextClassLoader(loader);
+                    }
+                }
+                create();
+            } finally {
+                Thread.currentThread().setContextClassLoader(orig);
+            }
+        }
+    }
+    
+    public void destroy() {
+        if (getServer() != null) {
+            getServer().destroy();
+            setServer(null);
+        }
+    }
 
     @Override
     protected void initializeServiceFactory() {

Added: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java?rev=1087182&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java (added)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java Thu Mar 31 04:12:31 2011
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.frontend.blueprint;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.cxf.configuration.blueprint.SimpleBPBeanDefinitionParser;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+
+public class ClientProxyFactoryBeanDefinitionParser extends SimpleBPBeanDefinitionParser {
+
+    public ClientProxyFactoryBeanDefinitionParser() {
+        this(ClientProxyFactoryBean.class);
+    }
+    public ClientProxyFactoryBeanDefinitionParser(Class cls) {
+        super(cls);
+    }
+    @Override
+    public String getFactorySuffix() {
+        return ".proxyFactory";
+    }
+    public String getFactoryCreateType(Element element) {
+        return element.getAttribute("serviceClass");
+    }
+
+    @Override
+    protected void mapAttribute(MutableBeanMetadata bean, 
+                                Element e, String name, 
+                                String val, ParserContext context) {
+        if ("endpointName".equals(name) || "serviceName".equals(name)) {
+            QName q = parseQName(e, val);
+            bean.addProperty(name, createValue(context, q));
+        } else {
+            mapToProperty(bean, name, val, context);
+        }
+    }
+    @Override
+    protected void mapElement(ParserContext ctx, MutableBeanMetadata bean, Element el, String name) {
+        if ("properties".equals(name)) {
+            bean.addProperty("properties", this.parseMapData(ctx, bean, el));
+        } else if ("binding".equals(name)) {
+            setFirstChildAsProperty(el, ctx, bean, "bindingConfig");
+        } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
+            || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+            || "features".equals(name) || "schemaLocations".equals(name)
+            || "handlers".equals(name)) {
+            bean.addProperty(name, this.parseListData(ctx, bean, el));
+        } else {
+            setFirstChildAsProperty(el, ctx, bean, name);            
+        }        
+    }
+    @Override
+    protected boolean hasBusProperty() {
+        return true;
+    }
+}

Propchange: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ClientProxyFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java?rev=1087182&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java (added)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java Thu Mar 31 04:12:31 2011
@@ -0,0 +1,100 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.frontend.blueprint;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.blueprint.SimpleBPBeanDefinitionParser;
+import org.apache.cxf.frontend.ServerFactoryBean;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+
+
+public class ServerFactoryBeanDefinitionParser extends SimpleBPBeanDefinitionParser {
+    
+
+    public ServerFactoryBeanDefinitionParser() {
+        this(ServerFactoryBean.class);
+    }
+    public ServerFactoryBeanDefinitionParser(Class cls) {
+        super(cls);
+    }
+    
+    @Override
+    protected void mapAttribute(MutableBeanMetadata bean, 
+                                Element e, String name, 
+                                String val, ParserContext context) {
+        if ("endpointName".equals(name) || "serviceName".equals(name)) {
+            QName q = parseQName(e, val);
+            bean.addProperty(name, createValue(context, q));
+        } else {
+            mapToProperty(bean, name, val, context);
+        }
+    }
+
+    @Override
+    protected void mapElement(ParserContext ctx, MutableBeanMetadata bean, Element el, String name) {
+        if ("properties".equals(name)) {
+            bean.addProperty("properties", this.parseMapData(ctx, bean, el));
+        } else if ("executor".equals(name)) {
+            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.executor");
+        } else if ("invoker".equals(name)) {
+            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.invoker");
+        } else if ("binding".equals(name)) {
+            setFirstChildAsProperty(el, ctx, bean, "bindingConfig");
+        } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
+            || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+            || "features".equals(name) || "schemaLocations".equals(name)) {
+            bean.addProperty(name, this.parseListData(ctx, bean, el));
+        } else {
+            setFirstChildAsProperty(el, ctx, bean, name);            
+        }        
+    }
+    
+
+    @Override
+    public Metadata parse(Element element, ParserContext context) {
+        MutableBeanMetadata bean = (MutableBeanMetadata)super.parse(element, context);
+        bean.setInitMethod("init");
+        bean.setDestroyMethod("destroy");
+
+        // We don't really want to delay the registration of our Server
+        bean.setActivation(MutableBeanMetadata.ACTIVATION_EAGER);
+        return bean;
+    }
+
+    @Override
+    public String getId(Element elem, ParserContext context) {
+        String id = super.getId(elem, context);
+        if (StringUtils.isEmpty(id)) {
+            id = cls.getName() + "--" + context.getDefaultActivation();
+        }
+        return id;
+    }
+
+    @Override
+    protected boolean hasBusProperty() {
+        return true;
+    }
+}

Propchange: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/ServerFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/SimpleBPNamespaceHandler.java (from r1087072, cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/SimpleBPNamespaceHandler.java?p2=cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/SimpleBPNamespaceHandler.java&p1=cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java&r1=1087072&r2=1087182&rev=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/JAXWSBPNamespaceHandler.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/SimpleBPNamespaceHandler.java Thu Mar 31 04:12:31 2011
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.jaxws.blueprint;
+package org.apache.cxf.frontend.blueprint;
 
 import java.net.URL;
 import java.util.Set;
@@ -34,23 +34,21 @@ import org.osgi.service.blueprint.reflec
 /**
  * 
  */
-public class JAXWSBPNamespaceHandler implements NamespaceHandler {
+public class SimpleBPNamespaceHandler implements NamespaceHandler {
     private BlueprintContainer blueprintContainer;
     
-    public JAXWSBPNamespaceHandler() {
+    public SimpleBPNamespaceHandler() {
     }
     
     public URL getSchemaLocation(String namespace) {
-        return getClass().getClassLoader().getResource("/schemas/blueprint/jaxws.xsd");
+        return getClass().getClassLoader().getResource("/schemas/blueprint/simple.xsd");
     }
 
 
     public Metadata parse(Element element, ParserContext context) {
         String s = element.getLocalName();
-        if ("endpoint".equals(s)) {
-            return new EndpointDefinitionParser().parse(element, context);
-        } else if ("server".equals(s)) {
-            //TODO
+        if ("server".equals(s)) {
+            return new ServerFactoryBeanDefinitionParser().parse(element, context);
         } else if ("client".equals(s)) {
             //TODO
         }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java?rev=1087182&r1=1087181&r2=1087182&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java Thu Mar 31 04:12:31 2011
@@ -120,12 +120,6 @@ public class ServerFactoryBeanDefinition
         public SpringServerFactoryBean(ReflectionServiceFactoryBean fact) {
             super(fact);
         }
-        public void destroy() {
-            if (getServer() != null) {
-                getServer().destroy();
-                setServer(null);
-            }
-        }
 
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {

Added: cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml?rev=1087182&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml (added)
+++ cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml Thu Mar 31 04:12:31 2011
@@ -0,0 +1,31 @@
+<!--
+  ~ /**
+  ~  * Licensed to the Apache Software Foundation (ASF) under one or more
+  ~  * contributor license agreements.  See the NOTICE file distributed with
+  ~  * this work for additional information regarding copyright ownership.
+  ~  * The ASF licenses this file to You under the Apache License, Version 2.0
+  ~  * (the "License"); you may not use this file except in compliance with
+  ~  * the License.  You may obtain a copy of the License at
+  ~  *
+  ~  *      http://www.apache.org/licenses/LICENSE-2.0
+  ~  *
+  ~  * Unless required by applicable law or agreed to in writing, software
+  ~  * distributed under the License is distributed on an "AS IS" BASIS,
+  ~  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  * See the License for the specific language governing permissions and
+  ~  * limitations under the License.
+  ~  */
+  -->
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+  <service interface="org.apache.aries.blueprint.NamespaceHandler">
+    <service-properties>
+      <entry key="osgi.service.blueprint.namespace" value="http://cxf.apache.org/blueprint/simple"/>
+    </service-properties>
+    <bean class="org.apache.cxf.frontend.blueprint.SimpleBPNamespaceHandler"/>
+  </service>
+</blueprint>
\ No newline at end of file

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/OSGI-INF/blueprint/cxf-simple.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd?rev=1087182&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd (added)
+++ cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd Thu Mar 31 04:12:31 2011
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<xsd:schema xmlns="http://cxf.apache.org/simple"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:beans="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+  xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
+  targetNamespace="http://cxf.apache.org/blueprint/simple" 
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified"  >
+
+  <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:element name="server" type="serverType">
+    <xsd:annotation>
+      <xsd:documentation>Configures a server implemented using the Simple front-end.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  
+  <xsd:complexType name="serverType">
+    <xsd:complexContent>
+      <xsd:extension base="beans:Tcomponent">
+        <xsd:all>
+          <xsd:element name="binding" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures the message binding used by the endpoint. Message bindings are configured using implementations of the 
+                  org.apache.cxf.binding.BindingFactory interface. The SOAP binding is configured using the soap:soapBinding bean.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="dataBinding" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures the data binding used by the endpoint.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="executor" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures a Java executor to handle the service.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="features" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of beans that configure advanced features.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>          
+          <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process incoming requests.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process incoming fault messages.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="invoker" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies an implementation of the org.apache.cxf.service.Invoker interface to be used by the service. The Invoker 
+                  implementation controls how a service is invoked. For example, it controls if each request is handled by a new instance of the 
+                  service implementation or if state is preserved across invocations.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process outgoing responses.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process outgoing fault messages.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="properties" type="beans:Tmap" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a map of properties that are passed to the endpoint.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="schemaLocations" type="schemasType" minOccurs="0"/>
+          <xsd:element name="serviceBean" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures the bean implementing the service. If this child is used you should not use the serviceBean attribute.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="serviceFactory" type="xsd:anyType" minOccurs="0"/>
+        </xsd:all>
+        <!--xsd:attributeGroup ref="cxf-beans:beanAttributes"/-->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the HTTP address of the endpoint. This value will override the value specified in the services 
+                contract.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="bindingId" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the ID of the data binding the service will use. The ID is the namespace of the WSDL extensions used to configure the
+                binding.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="bus" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the ID of the Spring bean configuring the bus managing the endpoint.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceClass" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the name of the class implementing the service. This attribute is useful when you specify the implementor 
+                with the ref bean which is wrapped by using Spring AOP.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceBean" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the class implementing the service. You can specify the implementation class using either the class 
+                name or an ID reference to a Spring bean configuring the implementation class. This class needs to be on the 
+                classpath.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="start" type="xsd:boolean" default="true">
+            <xsd:annotation>
+              <xsd:documentation>Specifies if the service should be automatically published.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transportId" type="xsd:string">
+        	<xsd:annotation>
+              <xsd:documentation>Specifies the transportId that endpoint will use, it will override the transport which is defined in the wsdl.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="wsdlLocation" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the location of the endpoint's WSDL contract. The WSDL contract's location is relative to the folder 
+                from which the service is deployed.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="endpointName" type="xsd:QName">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the value of the service's WSDL port element's name attribute.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceName" type="xsd:QName">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the value of the service's WSDL service element's name attribute.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <xsd:element name="client" type="clientType">
+    <xsd:annotation>
+      <xsd:documentation>Configures a client implemented using the Simple front-end.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  
+  <xsd:complexType name="clientType">
+    <xsd:complexContent>
+      <xsd:extension base="beans:Tcomponent">
+        <xsd:all>
+          <xsd:element name="binding" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures the message binding used by the endpoint. Message bindings are configured using implementations of the 
+                  org.apache.cxf.binding.BindingFactory interface. The SOAP binding is configured using the soap:soapBinding bean.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="conduitSelector" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a org.apache.cxf.endpoint.ConduitSelector implementation. ConduitSelector implementations override the 
+                  strategy used to select the Conduit used to process outgoing messages.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="dataBinding" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Configures the data binding used by the endpoint.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="features" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of beans that configure advanced features like WS-RM.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process incoming responses.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process incoming fault messages.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process outgoing requests.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a list of interceptors to process outgoing fault messages.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="properties" type="beans:Tmap" minOccurs="0">
+              <xsd:annotation>
+                <xsd:documentation>Specifies a map of properties that are passed to the endpoint.</xsd:documentation>
+              </xsd:annotation>
+          </xsd:element>
+        </xsd:all>
+        <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/-->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the HTTP address of the endpoint on which the client makes requests. This value will override the value 
+                specified in the services contract.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="bindingId" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the ID of the data binding the client will use. The ID is the namespace of the WSDL extensions used to 
+                configure the binding.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="bus" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the ID of the Spring bean configuring the bus managing the endpoint.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="endpointName" type="xsd:QName">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the value of the WSDL port element's name attribute for the service on which the client is making 
+                requests.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="password" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies a password that is used for simple username/password authentication.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceClass" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the name of the class implementing the client.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceName" type="xsd:QName">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the value of the WSDL service element's name attribute for the service on which the client is making 
+                requests.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="username" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies a password that is used for simple username/password authentication.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transportId" type="xsd:string">
+        	<xsd:annotation>
+              <xsd:documentation>Specifies the transportId that endpoint will use, it will override the transport which is defined in the wsdl.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>        
+        <xsd:attribute name="wsdlLocation" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>Specifies the location of the endpoint's WSDL contract. The WSDL contract's location is relative to the folder 
+                from which the client is deployed.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <xsd:complexType name="schemasType">
+    <xsd:sequence>
+      <xsd:element name="schemaLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  
+</xsd:schema>
\ No newline at end of file

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/frontend/simple/src/main/resources/schemas/blueprint/simple.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml