cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7010] Making setting a version for OSGI optional, trying to get a default bus in the formatted service list handler if the bus is null
Date Mon, 15 Aug 2016 22:08:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 004a87831 -> 9d7793bb8


[CXF-7010] Making setting a version for OSGI optional, trying to get a default bus in the
formatted service list handler if the bus is null


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

Branch: refs/heads/3.1.x-fixes
Commit: 9d7793bb8dc8ef6458948534242c7d0d5acc1829
Parents: 004a878
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Aug 15 23:06:31 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Aug 15 23:07:46 2016 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java | 7 ++++++-
 .../servlet/servicelist/FormattedServiceListWriter.java     | 9 +++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9d7793bb/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
index 4435a87..f52b991 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
@@ -39,7 +39,12 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
             }
             for (Bundle b : bundle.getBundleContext().getBundles()) {
                 String location = b.getLocation();
-                if (location.equals(LOCATION + swaggerUiVersion)) {
+                if (swaggerUiVersion != null) {
+                    if (location.equals(LOCATION + swaggerUiVersion)) {
+                        return getSwaggerUiRoot(b, swaggerUiVersion);
+                    }
+                } else if (location.startsWith(LOCATION)) {
+                    swaggerUiVersion = location.substring(LOCATION.length());
                     return getSwaggerUiRoot(b, swaggerUiVersion);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/9d7793bb/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
index 0c25519..ae9a4d4 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
@@ -24,6 +24,7 @@ import java.net.URI;
 import java.util.Map;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.util.PropertyUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.OperationInfo;
@@ -44,8 +45,12 @@ public class FormattedServiceListWriter implements ServiceListWriter {
         this.title = title;
         this.showForeignContexts = showForeignContexts;
         this.bus = bus;
-        if (bus != null) {
-            this.atomMap = CastUtils.cast((Map<?, ?>)bus.getProperty("org.apache.cxf.extensions.logging.atom.pull"));
+        if (this.bus == null) {
+            this.bus = BusFactory.getDefaultBus(false);
+        }
+        if (this.bus != null) {
+            this.atomMap = 
+                CastUtils.cast((Map<?, ?>)this.bus.getProperty("org.apache.cxf.extensions.logging.atom.pull"));
         }
     }
 


Mime
View raw message