cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1292839 - in /cxf/trunk: api/ api/src/main/java/org/apache/cxf/security/blueprint/ api/src/main/resources/OSGI-INF/ api/src/main/resources/OSGI-INF/blueprint/ rt/transports/http/ rt/transports/http/src/main/java/org/apache/cxf/transport/ht...
Date Thu, 23 Feb 2012 16:15:00 GMT
Author: ay
Date: Thu Feb 23 16:14:59 2012
New Revision: 1292839

URL: http://svn.apache.org/viewvc?rev=1292839&view=rev
Log:
[CXF-4084] Blueprint http (part 1 HTTPConduit)

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/
    cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java 
 (with props)
    cxf/trunk/api/src/main/resources/OSGI-INF/
    cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/
    cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml   (with props)
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java
  (with props)
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
  (with props)
    cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml   (with
props)
Modified:
    cxf/trunk/api/pom.xml
    cxf/trunk/rt/transports/http/pom.xml
    cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd

Modified: cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/pom.xml?rev=1292839&r1=1292838&r2=1292839&view=diff
==============================================================================
--- cxf/trunk/api/pom.xml (original)
+++ cxf/trunk/api/pom.xml Thu Feb 23 16:14:59 2012
@@ -149,6 +149,14 @@
             <groupId>wsdl4j</groupId>
             <artifactId>wsdl4j</artifactId>
         </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>
     </dependencies>
 
     <build>

Added: cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java?rev=1292839&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java Thu
Feb 23 16:14:59 2012
@@ -0,0 +1,62 @@
+/**
+ * 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.security.blueprint;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+/**
+ * 
+ */
+public class SecurityBPHandler implements NamespaceHandler {
+    
+    public SecurityBPHandler() {
+    }
+
+    public URL getSchemaLocation(String s) {
+        if ("http://cxf.apache.org/configuration/security".equals(s)) {
+            return getClass().getClassLoader().
+                getResource("/schemas/configuration/security.xsd");
+        }
+        return null;
+    }
+
+    public Metadata parse(Element element, ParserContext context) {
+        return null;
+    }
+    
+    @SuppressWarnings("rawtypes")
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+    
+    public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext
context) {
+        return null;
+    }
+
+}

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/security/blueprint/SecurityBPHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml?rev=1292839&view=auto
==============================================================================
--- cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml (added)
+++ cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml Thu Feb 23 16:14:59
2012
@@ -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/configuration/security"/>
+    </service-properties>
+    <bean class="org.apache.cxf.security.blueprint.SecurityBPHandler"/>
+  </service>
+</blueprint>
\ No newline at end of file

Propchange: cxf/trunk/api/src/main/resources/OSGI-INF/blueprint/cxf-security.xml
------------------------------------------------------------------------------
    svn:executable = *

Modified: cxf/trunk/rt/transports/http/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/pom.xml?rev=1292839&r1=1292838&r2=1292839&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/pom.xml (original)
+++ cxf/trunk/rt/transports/http/pom.xml Thu Feb 23 16:14:59 2012
@@ -93,6 +93,10 @@
             <scope>provided</scope>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Added: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java?rev=1292839&view=auto
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java
(added)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java
Thu Feb 23 16:14:59 2012
@@ -0,0 +1,72 @@
+/**
+ * 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.transport.http.blueprint;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+//import org.apache.aries.blueprint.ParserContext;
+//import org.osgi.service.blueprint.container.BlueprintContainer;
+//import org.osgi.service.blueprint.reflect.ComponentMetadata;
+//import org.osgi.service.blueprint.reflect.Metadata;
+import org.apache.aries.blueprint.ParserContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+/**
+ * 
+ */
+public class HttpBPHandler implements NamespaceHandler {
+    
+    public HttpBPHandler() {
+    }
+
+    public URL getSchemaLocation(String s) {
+        if ("http://cxf.apache.org/transports/http/configuration".equals(s)) {
+            return getClass().getClassLoader().
+                getResource("/schemas/configuration/http-conf.xsd");
+        }
+        return null;
+    }
+
+
+    public Metadata parse(Element element, ParserContext context) {
+        String s = element.getLocalName();
+
+        if ("conduit".equals(s)) {
+            return new HttpConduitBPBeanDefinitionParser().parse(element, context);
+        }
+        return null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+    
+    public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext
context) {
+        return null;
+    }
+    
+}

Propchange: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpBPHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java?rev=1292839&view=auto
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
(added)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
Thu Feb 23 16:14:59 2012
@@ -0,0 +1,71 @@
+/**
+ * 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.transport.http.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.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
+import org.apache.cxf.configuration.security.ProxyAuthorizationPolicy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class HttpConduitBPBeanDefinitionParser extends AbstractBPBeanDefinitionParser {
+    private static final String HTTP_NS =
+        "http://cxf.apache.org/transports/http/configuration";
+
+    public Metadata parse(Element element, ParserContext context) {
+        MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
+        
+        bean.setRuntimeClass(HTTPConduit.class);
+
+        mapElementToJaxbProperty(context, bean, element,
+                new QName(HTTP_NS, "client"), "client", HTTPClientPolicy.class);
+        mapElementToJaxbProperty(context, bean, element,
+                new QName(HTTP_NS, "proxyAuthorization"), "proxyAuthorization", 
+                ProxyAuthorizationPolicy.class);
+        mapElementToJaxbProperty(context, bean, element,
+                new QName(HTTP_NS, "authorization"), "authorization", AuthorizationPolicy.class);
+        
+        mapElementToJaxbProperty(context, bean, element,
+                new QName(HTTP_NS, "tlsClientParameters"), "tlsClientParameters", TLSClientParameters.class);
+        
+        //TODO handle those bean/ref dual entries (basicAuthSupplier and trustDecider)
+
+        parseAttributes(element, context, bean);
+        parseChildElements(element, context, bean);
+
+        bean.setScope(MutableBeanMetadata.SCOPE_PROTOTYPE);
+        
+        return bean;
+    }
+
+    @Override
+    protected void processNameAttribute(Element element, ParserContext context, MutableBeanMetadata
bean,
+                                        String val) {
+        bean.setId(val);
+    }
+}

Propchange: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml?rev=1292839&view=auto
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml (added)
+++ cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml Thu Feb
23 16:14:59 2012
@@ -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/transports/http/configuration"/>
+    </service-properties>
+    <bean class="org.apache.cxf.transport.http.blueprint.HttpBPHandler"/>
+  </service>
+</blueprint>

Propchange: cxf/trunk/rt/transports/http/src/main/resources/OSGI-INF/blueprint/cxf-http.xml
------------------------------------------------------------------------------
    svn:executable = *

Modified: cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd?rev=1292839&r1=1292838&r2=1292839&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd (original)
+++ cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd Thu
Feb 23 16:14:59 2012
@@ -25,23 +25,24 @@
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
            xmlns:sec="http://cxf.apache.org/configuration/security"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-           xmlns:beans="http://www.springframework.org/schema/beans" 
            xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
            elementFormDefault="qualified" 
            attributeFormDefault="unqualified"
            xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
            jaxb:version="2.0">
 
-    <xs:include schemaLocation="http://cxf.apache.org/schemas/wsdl/http-conf.xsd"/>

+    <xs:include schemaLocation="../wsdl/http-conf.xsd"/> 
     <xs:import namespace="http://schemas.xmlsoap.org/wsdl/" 
                schemaLocation="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd"/>
     <xs:import namespace="http://cxf.apache.org/configuration/security" 
                schemaLocation="http://cxf.apache.org/schemas/configuration/security.xsd"/>
-    <xs:import namespace="http://www.springframework.org/schema/beans" 
-               schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"/>
     <xs:import namespace="http://cxf.apache.org/configuration/beans" 
                schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
 
+    <xs:complexType name="identifiedType" abstract="true">
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+
     <!-- Conduit Specific Items -->
 
     <xs:element name="authorization"       type="sec:AuthorizationPolicy"/>
@@ -53,7 +54,7 @@
     <xs:element name="conduit">
       <xs:complexType>
         <xs:complexContent>
-          <xs:extension base="beans:identifiedType">
+          <xs:extension base="http-conf:identifiedType">
             <xs:all>
                 <xs:element ref="http-conf:client" minOccurs="0">
                    <xs:annotation>
@@ -127,7 +128,7 @@
     <xs:element name="destination">
       <xs:complexType>
         <xs:complexContent>
-          <xs:extension base="beans:identifiedType">
+          <xs:extension base="http-conf:identifiedType">
             <xs:all>
 	            <xs:element ref="http-conf:server" minOccurs="0">
 	               <xs:annotation>



Mime
View raw message