cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: CXF-7164: Support tracing using OpenZipkin Brave. Refactored JAX-RS BraveFeature to depend on JAX-RS API only.
Date Fri, 30 Dec 2016 00:28:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b6b987218 -> c8ee5ae67


CXF-7164: Support tracing using OpenZipkin Brave. Refactored JAX-RS BraveFeature to depend
on JAX-RS API only.


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

Branch: refs/heads/master
Commit: c8ee5ae674f6e59b26d7b549481627d21103f7c1
Parents: b6b9872
Author: reta <drreta@gmail.com>
Authored: Thu Dec 29 19:27:42 2016 -0500
Committer: reta <drreta@gmail.com>
Committed: Thu Dec 29 19:27:42 2016 -0500

----------------------------------------------------------------------
 .../cxf/tracing/brave/jaxrs/BraveFeature.java   | 25 +++++++-------------
 .../jaxrs/tracing/brave/BraveTracingTest.java   |  2 +-
 2 files changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c8ee5ae6/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
b/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
index b654fb6..f3e4468 100644
--- a/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
+++ b/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
@@ -18,16 +18,12 @@
  */
 package org.apache.cxf.tracing.brave.jaxrs;
 
-import java.util.Arrays;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
 
 import com.github.kristofa.brave.Brave;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
-
-public class BraveFeature extends AbstractFeature {
+public class BraveFeature implements Feature {
     private final Brave brave;
     
     public BraveFeature() {
@@ -41,16 +37,11 @@ public class BraveFeature extends AbstractFeature {
     public BraveFeature(final Brave brave) {
         this.brave = brave;
     }
-
+    
     @Override
-    public void initialize(final Server server, final Bus bus) {
-        final ServerProviderFactory providerFactory = (ServerProviderFactory)server
-            .getEndpoint()
-            .get(ServerProviderFactory.class.getName());
-        
-        if (providerFactory != null) {
-            providerFactory.setUserProviders(Arrays.asList(new BraveProvider(brave), 
-                new BraveContextProvider(brave)));
-        }
+    public boolean configure(FeatureContext context) {
+        context.register(new BraveProvider(brave));
+        context.register(new BraveContextProvider(brave));
+        return true;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c8ee5ae6/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
----------------------------------------------------------------------
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
index f1f1ab7..1b40bad 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
@@ -73,7 +73,7 @@ public class BraveTracingTest extends AbstractBusClientServerTestBase {
             sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore<TraceScope>()));
             sf.setAddress("http://localhost:" + PORT);
             sf.setProvider(new JacksonJsonProvider());
-            sf.setFeatures(Arrays.asList(new BraveFeature(brave)));
+            sf.setProvider(new BraveFeature(brave));
             sf.create();
         }
     }


Mime
View raw message