tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfis...@apache.org
Subject [1/2] tomee git commit: Allow custom JSON Providers to replace Johnzon
Date Wed, 17 Oct 2018 00:13:32 GMT
Repository: tomee
Updated Branches:
  refs/heads/master a48208ac3 -> 38959d7fd


Allow custom JSON Providers to replace Johnzon


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7f18f4bc
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7f18f4bc
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7f18f4bc

Branch: refs/heads/master
Commit: 7f18f4bcfe64119b9001d5ac6bffeb7324987a37
Parents: a48208a
Author: Jonathan S. Fisher <jonathan.fisher@emoneyusa.com>
Authored: Sat Sep 15 16:16:51 2018 -0500
Committer: Jonathan S. Fisher <exabrial@gmail.com>
Committed: Tue Oct 16 19:08:21 2018 -0500

----------------------------------------------------------------------
 .../org/apache/openejb/server/cxf/rs/CxfRSService.java | 13 ++++++++++---
 .../openejb/server/cxf/rs/CxfRsHttpListener.java       |  6 ++++--
 2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/7f18f4bc/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java
----------------------------------------------------------------------
diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java
b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java
index 347f42b..3f492ce 100644
--- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java
+++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java
@@ -223,9 +223,16 @@ public class CxfRSService extends RESTService {
             bus.setProperty("skip.default.json.provider.registration", "true"); // client
jaxrs, we want johnzon not jettison
 
             final Collection<Object> defaults = new ArrayList<>();
-            for (final String provider : asList(
-                    "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonbProvider",
-                    "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonpProvider")) {
+            List<String> jsonProviders;
+            String userConfiguredJsonProviders = SystemInstance.get().getProperty("openejb.jaxrs.jsonProviders");
+            if (userConfiguredJsonProviders == null) {
+                jsonProviders = asList(
+                        "org.apache.openejb.server.cxf.rs.johnzon.TomEEJohnzonProvider",
+                        "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonpProvider");
+            } else {
+                jsonProviders = asList(userConfiguredJsonProviders.split(","));
+            }
+            for (final String provider : jsonProviders) {
                 if (!isActive(provider)) {
                     continue;
                 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/7f18f4bc/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
----------------------------------------------------------------------
diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
index e155b9d..1fa8b1a 100644
--- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
+++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
@@ -498,8 +498,10 @@ public class CxfRsHttpListener implements RsHttpListener {
     }
 
     private void addMandatoryProviders(final Collection<Object> instances, final ServiceConfiguration
serviceConfiguration) {
-        if (!shouldSkipProvider(WadlDocumentMessageBodyWriter.class.getName())) {
-            instances.add(new WadlDocumentMessageBodyWriter());
+        if (SystemInstance.get().getProperty("openejb.jaxrs.jsonProviders") == null) {
+            if (!shouldSkipProvider(WadlDocumentMessageBodyWriter.class.getName())) {
+                instances.add(new WadlDocumentMessageBodyWriter());
+            }
         }
         if (!shouldSkipProvider(EJBExceptionMapper.class.getName())) {
             instances.add(new EJBExceptionMapper());


Mime
View raw message