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:58:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 51d3e219d -> 53d270e7f


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/53d270e7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/53d270e7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/53d270e7

Branch: refs/heads/3.0.x-fixes
Commit: 53d270e7f727e11dea26277ad573399d1547b9e1
Parents: 51d3e21
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:58:34 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/53d270e7/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/53d270e7/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/53d270e7/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