tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject incubator-tamaya git commit: TAMAYA-151: Replaced Jersey with CXF.
Date Wed, 20 Apr 2016 07:38:48 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 143f4d211 -> d035dbfd8


TAMAYA-151: Replaced Jersey with CXF.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/d035dbfd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/d035dbfd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/d035dbfd

Branch: refs/heads/master
Commit: d035dbfd8808fdbbc1eb7e75409f845ac1eeb929
Parents: 143f4d2
Author: anatole <anatole@apache.org>
Authored: Wed Apr 20 09:38:22 2016 +0200
Committer: anatole <anatole@apache.org>
Committed: Wed Apr 20 09:38:42 2016 +0200

----------------------------------------------------------------------
 modules/server/pom.xml                          | 45 +++-----------------
 .../apache/tamaya/server/ConfigServiceApp.java  | 19 ++++-----
 2 files changed, 14 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d035dbfd/modules/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/server/pom.xml b/modules/server/pom.xml
index 4e706ce..9b302d8 100644
--- a/modules/server/pom.xml
+++ b/modules/server/pom.xml
@@ -33,7 +33,6 @@ under the License.
     <properties>
         <jdkVersion>1.7</jdkVersion>
         <tomcat.version>7.0.57</tomcat.version>
-        <jersey.version>1.19.1</jersey.version>
     </properties>
 
     <dependencies>
@@ -58,48 +57,16 @@ under the License.
             <version>${tomcat.version}</version>
         </dependency>
         <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-            <version>1.1.1</version>
-            <scope>provided</scope>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaxrs_2.0_spec</artifactId>
+            <version>1.0-alpha-1</version>
         </dependency>
         <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-server</artifactId>
-            <version>${jersey.version}</version>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>3.1.6</version>
         </dependency>
         <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-
-        <!--<dependency>-->
-        <!--<groupId>org.apache.tomcat.embed</groupId>-->
-        <!--<artifactId>tomcat-embed-jasper</artifactId>-->
-        <!--<version>${tomcat.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-        <!--<groupId>org.apache.tomcat</groupId>-->
-        <!--<artifactId>tomcat-jasper</artifactId>-->
-        <!--<version>${tomcat.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-        <!--<groupId>org.apache.tomcat</groupId>-->
-        <!--<artifactId>tomcat-jasper-el</artifactId>-->
-        <!--<version>${tomcat.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-        <!--<groupId>org.apache.tomcat</groupId>-->
-        <!--<artifactId>tomcat-jsp-api</artifactId>-->
-        <!--<version>${tomcat.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-        <!--<groupId>jstl</groupId>-->
-        <!--<artifactId>jstl</artifactId>-->
-        <!--<version>1.2</version>-->
-        <!--</dependency>-->
-        <dependency>
             <groupId>org.apache.tamaya</groupId>
             <artifactId>tamaya-core</artifactId>
             <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d035dbfd/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java b/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
index c8a2810..1db06f3 100644
--- a/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
+++ b/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
@@ -18,8 +18,6 @@
  */
 package org.apache.tamaya.server;
 
-
-import com.sun.jersey.spi.container.servlet.ServletContainer;
 import org.apache.catalina.Context;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.startup.Tomcat;
@@ -44,12 +42,11 @@ public class ConfigServiceApp {
     /**
      * JAX RS Application.
      */
-    public class ResourceLoader extends Application{
+    public static class ResourceLoader extends Application{
 
         @Override
         public Set<Class<?>> getClasses() {
-            final Set<Class<?>> classes = new HashSet<Class<?>>();
-
+            final Set<Class<?>> classes = new HashSet<>();
             // register root resource
             classes.add(ConfigurationResource.class);
             return classes;
@@ -61,17 +58,17 @@ public class ConfigServiceApp {
         String contextPath = config.getOrDefault("tamaya.server.contextPath", "/");
         String appBase = ".";
         Tomcat tomcat = new Tomcat();
-        tomcat.setPort(Integer.valueOf(config.getOrDefault("tamaya.server.port", Integer.class,
8085) ));
+        tomcat.setPort(config.getOrDefault("tamaya.server.port", Integer.class, 8085));
 
         // Define a web application context.
         Context context = tomcat.addWebapp(contextPath, new File(
                 appBase).getAbsolutePath());
         // Add servlet that will register Jersey REST resources
-        Wrapper wrapper = tomcat.addServlet(context, "jersey-container-servlet",
-                ServletContainer.class.getName());
-        wrapper.addInitParameter("com.sun.jersey.config.property.packages",
-                ConfigurationResource.class.getPackage().getName());
-        context.addServletMapping("/*", "jersey-container-servlet");
+        String servletName = "cxf-servlet";
+        Wrapper wrapper = tomcat.addServlet(context, servletName,
+                org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet.class.getName());
+        wrapper.addInitParameter("javax.ws.rs.Application", ResourceLoader.class.getName());
+        context.addServletMapping("/*", servletName);
         tomcat.start();
         tomcat.getServer().await();
     }


Mime
View raw message