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 2009/09/29 17:27:02 UTC

svn commit: r819982 - in /cxf/trunk/rt: ./ transports/http-osgi/ transports/http-osgi/src/main/java/org/apache/cxf/ transports/http-osgi/src/main/java/org/apache/cxf/transport/ transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/ tran...

Author: dkulp
Date: Tue Sep 29 15:27:00 2009
New Revision: 819982

URL: http://svn.apache.org/viewvc?rev=819982&view=rev
Log:
re-package the osgi transport

Added:
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestination.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistry.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServlet.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactory.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/SpringOsgiServlet.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationTest.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServletTest.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java   (contents, props changed)
      - copied, changed from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactoryTest.java
Removed:
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestination.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistry.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServlet.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactory.java
    cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/SpringOsgiServlet.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationTest.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServletTest.java
    cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactoryTest.java
Modified:
    cxf/trunk/rt/pom.xml
    cxf/trunk/rt/transports/http-osgi/pom.xml
    cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/cxf/osgi/cxf-extension-osgi.xml
    cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/spring/cxf-transport-osgi.xml

Modified: cxf/trunk/rt/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/pom.xml?rev=819982&r1=819981&r2=819982&view=diff
==============================================================================
--- cxf/trunk/rt/pom.xml (original)
+++ cxf/trunk/rt/pom.xml Tue Sep 29 15:27:00 2009
@@ -46,6 +46,7 @@
         <module>frontend/js</module>
         <module>transports/http</module>
         <module>transports/http-jetty</module>
+        <module>transports/http-osgi</module>
         <module>transports/jms</module>
         <module>transports/jbi</module>
         <module>ws/policy</module>

Modified: cxf/trunk/rt/transports/http-osgi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/pom.xml?rev=819982&r1=819981&r2=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/pom.xml (original)
+++ cxf/trunk/rt/transports/http-osgi/pom.xml Tue Sep 29 15:27:00 2009
@@ -39,6 +39,16 @@
             <artifactId>org.osgi.compendium</artifactId>
             <version>1.2.0</version>
             <scope>provided</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>javax.servlet</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.foundation</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -46,20 +56,9 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-annotation_1.0_spec</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -96,7 +95,7 @@
                             *
                         </Import-Package>
                         <Export-Package>
-                            org.apache.servicemix.cxf.transport.http_osgi,
+                            org.apache.cxf.transport.http_osgi,
                             '=META-INF.cxf.osgi'
                         </Export-Package>
                         <_failok>true</_failok>

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestination.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestination.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestination.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.io.IOException;
 import java.util.logging.Level;
@@ -27,7 +27,6 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.MessageObserver;
 import org.apache.cxf.transport.http.AbstractHTTPDestination;
 
@@ -52,13 +51,12 @@
      * @throws IOException
      */
     public OsgiDestination(Bus b,
-                           ConduitInitiator ci,
                            EndpointInfo ei,
                            OsgiDestinationRegistryIntf fact,
                            String p)
         throws IOException {
         // would add the default port to the address
-        super(b, ci, ei, false);
+        super(b, ei, false);
         factory = fact;
         path = p;
     }

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestination.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistry.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistry.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistry.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.util.Collection;
 import java.util.Collections;

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistry.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.util.Collection;
 import java.util.Set;

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiDestinationRegistryIntf.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServlet.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServlet.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServlet.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.io.IOException;
 import java.io.InputStream;

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiServlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactory.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactory.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactory.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.io.IOException;
 import java.net.URI;
@@ -24,7 +24,6 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
 
 public class OsgiTransportFactory extends AbstractHTTPTransportFactory implements DestinationFactory {
@@ -35,24 +34,6 @@
         this.registry = registry;
     }
 
-    public void init() {
-        if (bus == null) {
-            throw new IllegalStateException("bus should not be null");
-        }
-        if (registry == null) {
-            throw new IllegalStateException("registry should not be null");
-        }
-        if (activationNamespaces == null) {
-            activationNamespaces = getTransportIds();
-        }
-        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        if (dfm != null && activationNamespaces != null) {
-            for (String ns : activationNamespaces) {
-                dfm.registerDestinationFactory(ns, this);
-            }
-        }
-    }
-
     public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
         if (URI.create(endpointInfo.getAddress()).isAbsolute()) {
             throw new IllegalStateException("Endpoint address should be a relative URI "
@@ -61,7 +42,7 @@
         OsgiDestination d = registry.getDestinationForPath(endpointInfo.getAddress());
         if (d == null) {
             String path = OsgiDestinationRegistry.getTrimmedPath(endpointInfo.getAddress());
-            d = new OsgiDestination(getBus(), null, endpointInfo, registry, path);
+            d = new OsgiDestination(getBus(), endpointInfo, registry, path);
             registry.addDestination(path, d);
         }
         return d;

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/SpringOsgiServlet.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java?p2=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java&p1=cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/SpringOsgiServlet.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/servicemix/cxf/transport/http_osgi/SpringOsgiServlet.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java Tue Sep 29 15:27:00 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/main/java/org/apache/cxf/transport/http_osgi/SpringOsgiServlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/cxf/osgi/cxf-extension-osgi.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/cxf/osgi/cxf-extension-osgi.xml?rev=819982&r1=819981&r2=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/cxf/osgi/cxf-extension-osgi.xml (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/cxf/osgi/cxf-extension-osgi.xml Tue Sep 29 15:27:00 2009
@@ -24,8 +24,8 @@
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd">
 
-    <bean id="org.apache.servicemix.cxf.transport.http_osgi.OsgiTransportFactory"
-          class="org.apache.servicemix.cxf.transport.http_osgi.OsgiTransportFactory"
+    <bean id="org.apache.cxf.transport.http_osgi.OsgiTransportFactory"
+          class="org.apache.cxf.transport.http_osgi.OsgiTransportFactory"
           init-method="init">
 
         <property name="bus" ref="cxf"/>
@@ -43,6 +43,6 @@
     </bean>
 
     <osgi:reference id="osgiDestinationRegistry"
-                    interface="org.apache.servicemix.cxf.transport.http_osgi.OsgiDestinationRegistryIntf" />
+                    interface="org.apache.cxf.transport.http_osgi.OsgiDestinationRegistryIntf" />
 
 </beans>

Modified: cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/spring/cxf-transport-osgi.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/spring/cxf-transport-osgi.xml?rev=819982&r1=819981&r2=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/spring/cxf-transport-osgi.xml (original)
+++ cxf/trunk/rt/transports/http-osgi/src/main/resources/META-INF/spring/cxf-transport-osgi.xml Tue Sep 29 15:27:00 2009
@@ -24,9 +24,9 @@
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd">
 
-    <bean id="destinationRegistry" class="org.apache.servicemix.cxf.transport.http_osgi.OsgiDestinationRegistry" />
+    <bean id="destinationRegistry" class="org.apache.cxf.transport.http_osgi.OsgiDestinationRegistry" />
 
-    <bean id="osgiServlet" class="org.apache.servicemix.cxf.transport.http_osgi.SpringOsgiServlet">
+    <bean id="osgiServlet" class="org.apache.cxf.transport.http_osgi.SpringOsgiServlet">
         <constructor-arg ref="destinationRegistry"/>
     </bean>
 
@@ -37,7 +37,7 @@
         </osgi:service-properties>
     </osgi:service>
 
-    <osgi:service ref="destinationRegistry" interface="org.apache.servicemix.cxf.transport.http_osgi.OsgiDestinationRegistryIntf">
+    <osgi:service ref="destinationRegistry" interface="org.apache.cxf.transport.http_osgi.OsgiDestinationRegistryIntf">
     </osgi:service>
 
 </beans>

Copied: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationTest.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java?p2=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java&p1=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationTest.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiDestinationTest.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java Tue Sep 29 15:27:00 2009
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.util.StringTokenizer;
 
@@ -26,9 +26,9 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.MessageObserver;
 
+import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
 import org.junit.After;
@@ -36,23 +36,20 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.easymock.classextension.EasyMock.*;
 
 public class OsgiDestinationTest extends Assert {
 
     private static final String ADDRESS = "http://bar/snafu";
     private IMocksControl control; 
     private Bus bus;
-    private ConduitInitiator ci;
     private OsgiDestinationRegistryIntf registry;
     private MessageObserver observer;
     private EndpointInfo endpoint;
 
     @Before
     public void setUp() {
-        control = createNiceControl();
+        control = EasyMock.createNiceControl();
         bus = control.createMock(Bus.class);
-        ci = control.createMock(ConduitInitiator.class);
         registry = control.createMock(OsgiDestinationRegistryIntf.class);
         observer = control.createMock(MessageObserver.class);
         endpoint = new EndpointInfo();
@@ -62,7 +59,6 @@
     @After
     public void tearDown() {
         bus = null;
-        ci = null;
         registry = null;
         observer = null;
     }
@@ -70,7 +66,7 @@
     @Test
     public void testCtor() throws Exception {
         OsgiDestination destination = 
-            new OsgiDestination(bus, ci, endpoint, registry, "snafu");
+            new OsgiDestination(bus, endpoint, registry, "snafu");
 
         assertNull(destination.getMessageObserver());
         assertNotNull(destination.getAddress());
@@ -86,7 +82,7 @@
         control.replay();
 
         OsgiDestination destination = 
-            new OsgiDestination(bus, ci, endpoint, registry, "snafu");
+            new OsgiDestination(bus, endpoint, registry, "snafu");
         destination.setMessageObserver(observer);
 
         destination.doMessage(message);
@@ -97,11 +93,11 @@
     @Test
     public void testShutdown() throws Exception {
         registry.removeDestination("snafu");
-        expectLastCall();
+        EasyMock.expectLastCall();
         control.replay();
 
         OsgiDestination destination = 
-            new OsgiDestination(bus, ci, endpoint, registry, "snafu");
+            new OsgiDestination(bus, endpoint, registry, "snafu");
 
         destination.shutdown();
          
@@ -113,15 +109,15 @@
         HttpServletRequest request =
             control.createMock(HttpServletRequest.class);
         message.get("HTTP.REQUEST");
-        expectLastCall().andReturn(request);
+        EasyMock.expectLastCall().andReturn(request);
         request.getHeaderNames();
-        expectLastCall().andReturn(new StringTokenizer("content-type content-length"));
+        EasyMock.expectLastCall().andReturn(new StringTokenizer("content-type content-length"));
         request.getHeaders("content-type");
-        expectLastCall().andReturn(new StringTokenizer("text/xml"));
+        EasyMock.expectLastCall().andReturn(new StringTokenizer("text/xml"));
         request.getHeaders("content-length");
-        expectLastCall().andReturn(new StringTokenizer("1234"));
+        EasyMock.expectLastCall().andReturn(new StringTokenizer("1234"));
         observer.onMessage(message);
-        expectLastCall();
+        EasyMock.expectLastCall();
         return message;
     }
 }

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiDestinationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServletTest.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java?p2=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java&p1=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServletTest.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiServletTest.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java Tue Sep 29 15:27:00 2009
@@ -17,11 +17,12 @@
  * under the License.
  */
 
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -47,6 +48,7 @@
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
 import org.apache.cxf.wsdl.http.AddressType;
 
+import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
 import org.junit.After;
@@ -54,7 +56,6 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.easymock.classextension.EasyMock.*;
 
 public class OsgiServletTest extends Assert {
 
@@ -92,7 +93,7 @@
 
     @Before
     public void setUp() {
-        control = createNiceControl();
+        control = EasyMock.createNiceControl();
         bus = control.createMock(Bus.class);
         registry = control.createMock(OsgiDestinationRegistryIntf.class);
         destination = control.createMock(OsgiDestination.class);
@@ -215,63 +216,63 @@
     private void setUpRequest(String requestURI,
                               String path,
                               int destinationCount) throws Exception {
-        expect(request.getRequestURI()).andReturn(requestURI).anyTimes();
+        EasyMock.expect(request.getRequestURI()).andReturn(requestURI).anyTimes();
         StringBuffer url = new StringBuffer(ROOT + requestURI);
-        expect(request.getRequestURL()).andReturn(url).anyTimes();
-        expect(request.getQueryString()).andReturn(QUERY).anyTimes();
-        expect(destination.getEndpointInfo()).andReturn(endpoint).anyTimes();
-        expect(destination.getBus()).andReturn(bus).anyTimes();
+        EasyMock.expect(request.getRequestURL()).andReturn(url).anyTimes();
+        EasyMock.expect(request.getQueryString()).andReturn(QUERY).anyTimes();
+        EasyMock.expect(destination.getEndpointInfo()).andReturn(endpoint).anyTimes();
+        EasyMock.expect(destination.getBus()).andReturn(bus).anyTimes();
 
-        expect(request.getPathInfo()).andReturn(path != null 
+        EasyMock.expect(request.getPathInfo()).andReturn(path != null 
                                                 ? path
                                                 : ADDRESS).anyTimes();
         if (path != null) {
-            expect(registry.getDestinationForPath(path)).andReturn(destination);
+            EasyMock.expect(registry.getDestinationForPath(path)).andReturn(destination);
         }
 
         if (destinationCount == -1) {
-            expect(registry.getDestinationsPaths()).andReturn(paths).anyTimes();
+            EasyMock.expect(registry.getDestinationsPaths()).andReturn(paths).anyTimes();
         } else if (destinationCount >= 0) {
-            expect(registry.getDestinationsPaths()).andReturn(paths);
+            EasyMock.expect(registry.getDestinationsPaths()).andReturn(paths);
             List<OsgiDestination> destinations =
                 new ArrayList<OsgiDestination>();
             for (int i = 0; i < destinationCount; i++) {
                 destinations.add(destination);
             }
-            expect(registry.getDestinations()).andReturn(destinations);
+            EasyMock.expect(registry.getDestinations()).andReturn(destinations);
         }
     }
 
     private void setUpMessage() throws Exception {
         ServletInputStream sis = control.createMock(ServletInputStream.class);
-        expect(request.getInputStream()).andReturn(sis);
-        message.setContent(eq(InputStream.class), same(sis));
-        expectLastCall();
+        EasyMock.expect(request.getInputStream()).andReturn(sis);
+        message.setContent(EasyMock.eq(InputStream.class), EasyMock.same(sis));
+        EasyMock.expectLastCall();
         setUpProperty(AbstractHTTPDestination.HTTP_REQUEST, request);
         setUpProperty(AbstractHTTPDestination.HTTP_RESPONSE, response);
         setUpProperty(AbstractHTTPDestination.HTTP_CONTEXT, context);
         setUpProperty(AbstractHTTPDestination.HTTP_CONFIG, config);
-        expect(request.getMethod()).andReturn(VERB);
+        EasyMock.expect(request.getMethod()).andReturn(VERB);
         setUpProperty(Message.HTTP_REQUEST_METHOD, VERB);
         setUpProperty(Message.REQUEST_URI, URI);
         setUpProperty(Message.QUERY_STRING, QUERY);
-        expect(request.getContentType()).andReturn(XML);
+        EasyMock.expect(request.getContentType()).andReturn(XML);
         setUpProperty(Message.CONTENT_TYPE, XML);
-        expect(request.getHeader("Accept")).andReturn(XML);
+        EasyMock.expect(request.getHeader("Accept")).andReturn(XML);
         setUpProperty(Message.ACCEPT_CONTENT_TYPE, XML);
         destination.getAddress();
-        expectLastCall().andReturn(EndpointReferenceUtils.getEndpointReference(PATH));
+        EasyMock.expectLastCall().andReturn(EndpointReferenceUtils.getEndpointReference(PATH));
         setUpProperty(Message.BASE_PATH, PATH);
-        message.put(eq(SecurityContext.class), isA(SecurityContext.class));
-        expect(request.getCharacterEncoding()).andReturn(ENCODING);
+        message.put(EasyMock.eq(SecurityContext.class), EasyMock.isA(SecurityContext.class));
+        EasyMock.expect(request.getCharacterEncoding()).andReturn(ENCODING);
         setUpProperty(Message.ENCODING, ENCODING);
-        exchange.setSession(isA(HTTPSession.class));
-        expectLastCall();
+        exchange.setSession(EasyMock.isA(HTTPSession.class));
+        EasyMock.expectLastCall();
     }
 
     private void setUpProperty(String name, Object value) {
-        message.put(eq(name), same(value));
-        expectLastCall().andReturn(null).anyTimes();
+        message.put(EasyMock.eq(name), EasyMock.same(value));
+        EasyMock.expectLastCall().andReturn(null).anyTimes();
     }
 
     private void setUpResponse(int status, 
@@ -279,18 +280,18 @@
                                String ... responseMsgs) throws Exception {
         if (status != 0) {
             response.setStatus(status);
-            expectLastCall();
+            EasyMock.expectLastCall();
         }
         if (responseType != null) {
             response.setContentType(responseType);
-            expectLastCall();
+            EasyMock.expectLastCall();
         }
         if (responseMsgs != null) {
             PrintWriter writer = control.createMock(PrintWriter.class);
-            expect(response.getWriter()).andReturn(writer).anyTimes();
+            EasyMock.expect(response.getWriter()).andReturn(writer).anyTimes();
             for (String msg : responseMsgs) { 
                 writer.write(msg);
-                expectLastCall();
+                EasyMock.expectLastCall();
             }
         }
     }
@@ -298,32 +299,33 @@
     private void setUpQuery() throws Exception {
         QueryHandlerRegistry qrh = 
             control.createMock(QueryHandlerRegistry.class);
-        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(qrh).anyTimes();
+        EasyMock.expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(qrh).anyTimes();
         QueryHandler qh = control.createMock(QueryHandler.class);
         List<QueryHandler> handlers = new ArrayList<QueryHandler>();
         handlers.add(qh);
-        expect(qrh.getHandlers()).andReturn(handlers);
+        EasyMock.expect(qrh.getHandlers()).andReturn(handlers);
         String base = ROOT + URI + "?" + QUERY;
-        expect(qh.isRecognizedQuery(eq(base),
-                                    eq(PATH),
-                                    same(endpoint))).andReturn(Boolean.TRUE);
-        expect(qh.getResponseContentType(eq(base), eq(PATH))).andReturn(XML);
+        EasyMock.expect(qh.isRecognizedQuery(EasyMock.eq(base),
+                                             EasyMock.eq(PATH),
+                                             EasyMock.same(endpoint))).andReturn(Boolean.TRUE);
+        EasyMock.expect(qh.getResponseContentType(EasyMock.eq(base),
+                                                  EasyMock.eq(PATH))).andReturn(XML);
         ServletOutputStream sos = control.createMock(ServletOutputStream.class);
-        expect(response.getOutputStream()).andReturn(sos);
-        qh.writeResponse(eq(base), eq(PATH), same(endpoint), same(sos)); 
-        expectLastCall();
+        EasyMock.expect(response.getOutputStream()).andReturn(sos);
+        qh.writeResponse(EasyMock.eq(base), EasyMock.eq(PATH), EasyMock.same(endpoint), EasyMock.same(sos)); 
+        EasyMock.expectLastCall();
         sos.flush();
-        expectLastCall();
+        EasyMock.expectLastCall();
     }
 
     private void setUpRestful() {
         paths.add(ADDRESS);
-        expect(registry.getDestinationForPath(ADDRESS)).andReturn(null);
-        expect(registry.getDestinationForPath(ADDRESS)).andReturn(destination).times(2);
-        expect(destination.getMessageObserver()).andReturn(observer);
+        EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(null);
+        EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(destination).times(2);
+        EasyMock.expect(destination.getMessageObserver()).andReturn(observer);
         endpoint.addExtensor(extensor);
-        extensor.setLocation(eq(ROOT + "/cxf/Soap" + ADDRESS));
-        expectLastCall();
+        extensor.setLocation(EasyMock.eq(ROOT + "/cxf/Soap" + ADDRESS));
+        EasyMock.expectLastCall();
     }
 
     private OsgiServlet setUpServlet() { 

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java (from r819955, cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactoryTest.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java?p2=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java&p1=cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactoryTest.java&r1=819955&r2=819982&rev=819982&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/servicemix/cxf/transport/http_osgi/OsgiTransportFactoryTest.java (original)
+++ cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java Tue Sep 29 15:27:00 2009
@@ -17,16 +17,15 @@
  * under the License.
  */
 
-package org.apache.servicemix.cxf.transport.http_osgi;
+package org.apache.cxf.transport.http_osgi;
 
-import java.util.Arrays;
-import java.util.List;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactoryManager;
 
+import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
 import org.junit.After;
@@ -34,32 +33,21 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.easymock.classextension.EasyMock.*;
-
-
 public class OsgiTransportFactoryTest extends Assert {
 
-    private static final List<String> TRANSPORT_IDS = (List<String>) 
-        Arrays.asList("http://cxf.apache.org/bindings/xformat",
-                      "http://schemas.xmlsoap.org/soap/http",
-                      "http://schemas.xmlsoap.org/wsdl/http/",
-                      "http://schemas.xmlsoap.org/wsdl/soap/http",
-                      "http://www.w3.org/2003/05/soap/bindings/HTTP/",
-                      "http://cxf.apache.org/transports/http/configuration");
-
     private IMocksControl control; 
     private OsgiTransportFactory factory;
     private Bus bus;
-    private DestinationFactoryManager dfm;
     private OsgiDestinationRegistryIntf registry;
 
     @Before
     public void setUp() {
-        control = createNiceControl();
+        control = EasyMock.createNiceControl();
         factory = new OsgiTransportFactory();
         registry = control.createMock(OsgiDestinationRegistryIntf.class);
         bus = control.createMock(Bus.class);
-        dfm = control.createMock(DestinationFactoryManager.class);
+        bus.getExtension(DestinationFactoryManager.class);
+        EasyMock.expectLastCall().andReturn(null).anyTimes();
     }
 
     @After
@@ -67,45 +55,16 @@
         factory = null;
         registry = null;
         bus = null;
-        dfm = null;
     }
 
-    @Test
-    public void testInit() throws Exception {
-        try {
-            factory.init();
-            fail("expected  IllegalStateException on null bus");
-        } catch (IllegalStateException ise) {
-            // expected
-        }
-        factory.setBus(bus);
-
-        try {
-            factory.init();
-            fail("expected  IllegalStateException on null registry");
-        } catch (IllegalStateException ise) {
-            // expected
-        }
-        factory.setRegistry(registry);
-        
-        bus.getExtension(DestinationFactoryManager.class);
-        expectLastCall().andReturn(dfm);
-        factory.setTransportIds(TRANSPORT_IDS);
-        for (String ns : TRANSPORT_IDS) {
-            dfm.registerDestinationFactory(ns, factory);
-            expectLastCall();
-        }
-        control.replay();
-
-        factory.init();
-
-        control.verify();
-    }
     
     @Test
     public void testGetDestination() throws Exception {
-        factory.setBus(bus);
+        registry.addDestination(EasyMock.eq("/snafu"), EasyMock.isA(OsgiDestination.class));
+        control.replay();
+        
         factory.setRegistry(registry);
+        factory.setBus(bus);
 
         EndpointInfo endpoint = new EndpointInfo();
         endpoint.setAddress("http://bar/snafu");
@@ -117,9 +76,6 @@
         }
  
         endpoint.setAddress("snafu");
-        registry.addDestination(eq("/snafu"), isA(OsgiDestination.class));
-
-        control.replay();
 
         Destination d = factory.getDestination(endpoint);
         assertNotNull(d);

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiTransportFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date