servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r732204 - in /servicemix/smx3/trunk/distributions/apache-servicemix-web: pom.xml src/main/java/org/apache/servicemix/web/cxf/ src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java src/main/webapp/WEB-INF/web.xml
Date Wed, 07 Jan 2009 02:30:56 GMT
Author: ffang
Date: Tue Jan  6 18:30:56 2009
New Revision: 732204

URL: http://svn.apache.org/viewvc?rev=732204&view=rev
Log:
[SM-1756]add CXFManagedServlet to apache-servicemix-web to enable servicemix-cxf-bc endpoint
deploy into servlet container without starting jetty

Added:
    servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/
    servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
  (with props)
Modified:
    servicemix/smx3/trunk/distributions/apache-servicemix-web/pom.xml
    servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml

Modified: servicemix/smx3/trunk/distributions/apache-servicemix-web/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix-web/pom.xml?rev=732204&r1=732203&r2=732204&view=diff
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix-web/pom.xml (original)
+++ servicemix/smx3/trunk/distributions/apache-servicemix-web/pom.xml Tue Jan  6 18:30:56
2009
@@ -151,6 +151,26 @@
       <artifactId>servicemix-http</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-transports-http</artifactId>
+      <version>${cxf-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxws</artifactId>
+      <version>${cxf-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-transports-jbi</artifactId>
+      <version>${cxf-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-bindings-jbi</artifactId>
+      <version>${cxf-version}</version>
+    </dependency>
   </dependencies>
 
   <build>

Added: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java?rev=732204&view=auto
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
(added)
+++ servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
Tue Jan  6 18:30:56 2009
@@ -0,0 +1,53 @@
+/*
+ * 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.servicemix.web.cxf;
+
+
+import java.util.logging.Logger;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
+import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
+
+
+
+public class CXFManagedServlet extends CXFNonSpringServlet {
+    
+    static final Logger LOG = getLogger();
+    @Override
+    public void loadBus(ServletConfig servletConfig) throws ServletException {
+        loadBusNoConfig(servletConfig);
+        // You could add the endpoint publish codes here
+    }
+
+    private void loadBusNoConfig(ServletConfig servletConfig) throws ServletException {
+
+        bus = BusFactory.getDefaultBus();
+        ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+        resourceManager.addResourceResolver(new ServletContextResourceResolver(
+                                               servletConfig.getServletContext()));
+
+        replaceDestinationFactory();
+        // Set up the ServletController
+        controller = createServletController(servletConfig);
+
+    }
+}

Propchange: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml?rev=732204&r1=732203&r2=732204&view=diff
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
(original)
+++ servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
Tue Jan  6 18:30:56 2009
@@ -104,6 +104,18 @@
         <url-pattern>/jbi/*</url-pattern>
     </servlet-mapping>
 
+    <servlet>
+      <servlet-name>cxf</servlet-name>
+      <display-name>cxf</display-name>
+      <description>Apache CXF Endpoint</description>
+      <servlet-class>org.apache.servicemix.web.cxf.CXFManagedServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+      <servlet-name>cxf</servlet-name>
+      <url-pattern>/services/*</url-pattern>
+  </servlet-mapping>
+
 	  <welcome-file-list>
 			<welcome-file>index.html</welcome-file>
 			<welcome-file>index.jsp</welcome-file>



Mime
View raw message