cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/3] cxf git commit: Introducing activateOnlyIfJaxrsSupported for explicit activation control
Date Wed, 02 Dec 2015 16:10:42 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes ec399a6a7 -> 3378549cb
  refs/heads/3.1.x-fixes e4c456743 -> 4870b845d
  refs/heads/master e915cfd79 -> 3d15737a9


Introducing activateOnlyIfJaxrsSupported for explicit activation control


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

Branch: refs/heads/3.1.x-fixes
Commit: 4870b845d0b04db2e0d03d7f4aa2cefc2edb1bf4
Parents: e4c4567
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Dec 2 17:09:06 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Dec 2 17:09:06 2015 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/swagger/AbstractSwaggerFeature.java       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4870b845/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
index 08d2e16..386855d 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
@@ -34,6 +34,7 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature {
 
     protected boolean scan = true;
     protected boolean runAsFilter;
+    private boolean activateOnlyIfJaxrsSupported;
     private String resourcePackage;
     private String version = "1.0.0";
     // depending on swagger version basePath is set differently
@@ -57,7 +58,7 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature {
 
     @Override
     public void initialize(Server server, Bus bus) {
-        if (SWAGGER_JAXRS_AVAILABLE) {
+        if (!activateOnlyIfJaxrsSupported || SWAGGER_JAXRS_AVAILABLE) {
             calculateDefaultResourcePackage(server);
             calculateDefaultBasePath(server);
             addSwaggerResource(server);
@@ -161,4 +162,13 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature
{
     public void setRunAsFilter(boolean runAsFilter) {
         this.runAsFilter = runAsFilter;
     }
+
+    public boolean isActivateOnlyIfJaxrsSupported() {
+        return activateOnlyIfJaxrsSupported;
+    }
+
+    public void setActivateOnlyIfJaxrsSupported(boolean activateOnlyIfJaxrsSupported) {
+        this.activateOnlyIfJaxrsSupported = activateOnlyIfJaxrsSupported;
+    }
+    
 }


Mime
View raw message