cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor updates to WADLgenerator and JAXRS client
Date Tue, 05 May 2015 10:57:31 GMT
Repository: cxf
Updated Branches:
  refs/heads/master d1b988b21 -> 68b821531


Minor updates to WADLgenerator and JAXRS client


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/68b82153
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/68b82153
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/68b82153

Branch: refs/heads/master
Commit: 68b821531addbf8793b238123b0c2fe01bf7a9c2
Parents: d1b988b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue May 5 11:57:12 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue May 5 11:57:12 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxrs/client/AbstractClient.java |  3 +++
 .../org/apache/cxf/jaxrs/client/ClientConfiguration.java |  9 +++++++++
 .../org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java   | 11 ++++++++---
 3 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/68b82153/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 0826a41..c36d6a9 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -314,6 +314,9 @@ public abstract class AbstractClient implements Client {
                 cfg.getConduit().close();
             }
             state.reset();
+            if (cfg.isShutdownBusOnClose()) {
+                cfg.getBus().shutdown(false);
+            }
             state = null;
             cfg = null;
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/68b82153/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
index 2db794c..0a3e0ba 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
@@ -61,6 +61,7 @@ public class ClientConfiguration implements InterceptorProvider, ConduitSelector
     private Map<String, Object> requestContext = new HashMap<String, Object>();
     private Map<String, Object> responseContext = new HashMap<String, Object>();
     private long synchronousTimeout = 60000;
+    private boolean shutdownBusOnClose;
     
     public long getSynchronousTimeout() {
         Conduit conduit = getConduit();
@@ -236,4 +237,12 @@ public class ClientConfiguration implements InterceptorProvider, ConduitSelector
     public Endpoint getEndpoint() {
         return conduitSelector == null ? null : conduitSelector.getEndpoint();
     }
+
+    public boolean isShutdownBusOnClose() {
+        return shutdownBusOnClose;
+    }
+
+    public void setShutdownBusOnClose(boolean shutdownBusOnClose) {
+        this.shutdownBusOnClose = shutdownBusOnClose;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/68b82153/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index 8e8ea91..8974f1e 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -282,9 +282,14 @@ public class WadlGenerator implements ContainerRequestFilter {
         Set<Class<?>> allTypes = resourceTypes.getAllTypes().keySet();
         
         
-        JAXBContext jaxbContext = useJaxbContextForQnames ? ResourceUtils
-            .createJaxbContext(new HashSet<Class<?>>(allTypes), null, null) :
null;
-
+        JAXBContext jaxbContext = null;
+        if (useJaxbContextForQnames && !allTypes.isEmpty()) { 
+            jaxbContext = ResourceUtils.createJaxbContext(new HashSet<Class<?>>(allTypes),
null, null);
+            if (jaxbContext == null) {
+                LOG.warning("JAXB Context is null: possibly due to one of input classes being
not accepted");
+            }
+        } 
+            
         SchemaWriter schemaWriter = createSchemaWriter(resourceTypes, jaxbContext, ui);
         ElementQNameResolver qnameResolver = schemaWriter == null
             ? null : createElementQNameResolver(jaxbContext);


Mime
View raw message