You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by gn...@apache.org on 2011/10/11 14:58:07 UTC

svn commit: r1181762 - in /cxf/trunk/services/wsn: ./ wsn-core/ wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/ wsn-osgi/ wsn-osgi/src/ wsn-osgi/src/main/ wsn-osgi/src/main/resources/ wsn-osgi/src/main/resources/OSGI-INF/ wsn-osgi/src/main/resources/O...

Author: gnodet
Date: Tue Oct 11 12:58:07 2011
New Revision: 1181762

URL: http://svn.apache.org/viewvc?rev=1181762&view=rev
Log:
[CXF-3848] Add osgi support for WSN

Added:
    cxf/trunk/services/wsn/wsn-osgi/
    cxf/trunk/services/wsn/wsn-osgi/pom.xml
    cxf/trunk/services/wsn/wsn-osgi/src/
    cxf/trunk/services/wsn/wsn-osgi/src/main/
    cxf/trunk/services/wsn/wsn-osgi/src/main/resources/
    cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/
    cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/
    cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/cxf-wsn.xml
Modified:
    cxf/trunk/services/wsn/pom.xml
    cxf/trunk/services/wsn/wsn-core/pom.xml
    cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/JaxwsEndpointManager.java

Modified: cxf/trunk/services/wsn/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/pom.xml?rev=1181762&r1=1181761&r2=1181762&view=diff
==============================================================================
--- cxf/trunk/services/wsn/pom.xml (original)
+++ cxf/trunk/services/wsn/pom.xml Tue Oct 11 12:58:07 2011
@@ -34,6 +34,7 @@
 
     <modules>
         <module>wsn-core</module>
+        <module>wsn-osgi</module>
     </modules>
 
 </project>

Modified: cxf/trunk/services/wsn/wsn-core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-core/pom.xml?rev=1181762&r1=1181761&r2=1181762&view=diff
==============================================================================
--- cxf/trunk/services/wsn/wsn-core/pom.xml (original)
+++ cxf/trunk/services/wsn/wsn-core/pom.xml Tue Oct 11 12:58:07 2011
@@ -29,7 +29,7 @@
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-parent</artifactId>
         <version>2.5.0-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
     <properties>

Modified: cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/JaxwsEndpointManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/JaxwsEndpointManager.java?rev=1181762&r1=1181761&r2=1181762&view=diff
==============================================================================
--- cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/JaxwsEndpointManager.java (original)
+++ cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jaxws/JaxwsEndpointManager.java Tue Oct 11 12:58:07 2011
@@ -25,9 +25,15 @@ import org.apache.cxf.wsn.EndpointRegist
 public class JaxwsEndpointManager implements EndpointManager {
 
     public Object register(String address, Object service) throws EndpointRegistrationException {
-        Endpoint endpoint = Endpoint.create(service);
-        endpoint.publish(address);
-        return endpoint;
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(JaxwsEndpointManager.class.getClassLoader());
+            Endpoint endpoint = Endpoint.create(service);
+            endpoint.publish(address);
+            return endpoint;
+        } finally {
+            Thread.currentThread().setContextClassLoader(cl);
+        }
     }
 
     public void unregister(Object endpoint) throws EndpointRegistrationException {

Added: cxf/trunk/services/wsn/wsn-osgi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-osgi/pom.xml?rev=1181762&view=auto
==============================================================================
--- cxf/trunk/services/wsn/wsn-osgi/pom.xml (added)
+++ cxf/trunk/services/wsn/wsn-osgi/pom.xml Tue Oct 11 12:58:07 2011
@@ -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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-services-wsn-osgi</artifactId>
+    <packaging>bundle</packaging>
+    <version>2.5.0-SNAPSHOT</version>
+    <name>Apache CXF WSN OSGi</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-services-wsn-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Require-Bundle>
+                            org.apache.activemq.activemq-core
+                        </Require-Bundle>
+                        <Import-Package>
+                            *
+                        </Import-Package>
+                        <Export-Package>
+                            org.oasis_open.docs.wsn.*;version=1.3;-noimport:=true,
+                            org.oasis_open.docs.wsrf.*;version=1.2,
+                            org.apache.cxf.wsn.client;version=${project.version}
+                        </Export-Package>
+                        <Private-Package>
+                            org.apache.cxf.wsn.*
+                        </Private-Package>
+                        <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

Added: cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/cxf-wsn.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/cxf-wsn.xml?rev=1181762&view=auto
==============================================================================
--- cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/cxf-wsn.xml (added)
+++ cxf/trunk/services/wsn/wsn-osgi/src/main/resources/OSGI-INF/blueprint/cxf-wsn.xml Tue Oct 11 12:58:07 2011
@@ -0,0 +1,60 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
+
+    <!-- AdminConfig property place holder for the org.apache.cxf.wsn  -->
+    <cm:property-placeholder persistent-id="org.apache.cxf.wsn" update-strategy="reload">
+        <cm:default-properties>
+            <cm:property name="cxf.wsn.activemq" value="vm:broker:(tcp://localhost)?persistent=false&amp;jmx=false"/>
+            <cm:property name="cxf.wsn.port" value="8182" />
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+    <!-- ActiveMQ connection factory -->
+    <bean id="activemq" class="org.apache.activemq.ActiveMQConnectionFactory">
+        <argument value="${cxf.wsn.activemq}" />
+    </bean>
+
+    <!-- NotificationBroker -->
+    <bean id="notificationBroker" class="org.apache.cxf.wsn.jaxws.JaxwsNotificationBroker" init-method="init" destroy-method="destroy">
+        <argument value="NotificationBroker" />
+        <argument ref="activemq" />
+        <property name="address" value="http://0.0.0.0:${cxf.wsn.port}/wsn/NotificationBroker" />
+    </bean>
+    <service ref="notificationBroker" interface="org.oasis_open.docs.wsn.brw_2.NotificationBroker">
+        <service-properties>
+            <entry key="address" value="http://0.0.0.0:${cxf.wsn.port}/wsn/NotificationBroker" />
+        </service-properties>
+    </service>
+
+    <!-- CreatePullPoint -->
+    <bean id="createPullPoint" class="org.apache.cxf.wsn.jaxws.JaxwsCreatePullPoint" init-method="init" destroy-method="destroy">
+        <argument value="org.apache.cxf.wsn.client.CreatePullPoint" />
+        <argument ref="activemq" />
+        <property name="address" value="http://0.0.0.0:${cxf.wsn.port}/wsn/CreatePullPoint" />
+    </bean>
+    <service ref="createPullPoint" interface="org.oasis_open.docs.wsn.bw_2.CreatePullPoint">
+        <service-properties>
+            <entry key="address" value="http://0.0.0.0:${cxf.wsn.port}/wsn/CreatePullPoint" />
+        </service-properties>
+    </service>
+
+</blueprint>
\ No newline at end of file