zipkin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abe...@apache.org
Subject [incubator-zipkin-brave-karaf] 27/43: Fix component setup to be compatible to OSGi R6
Date Thu, 31 Jan 2019 10:27:06 GMT
This is an automated email from the ASF dual-hosted git repository.

abesto pushed a commit to branch jenkinsfile-tweaks
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave-karaf.git

commit 43ae7e42c4cc792291ec6d611a2676bbc765f744
Author: Christian Schneider <cschneid@adobe.com>
AuthorDate: Wed Aug 1 14:44:24 2018 +0200

    Fix component setup to be compatible to OSGi R6
---
 .../io/zipkin/brave/exporter/AsyncReporterExporter.java     | 10 +++-------
 .../java/io/zipkin/brave/exporter/HttpTracingExporter.java  | 13 +++++--------
 .../main/java/io/zipkin/brave/exporter/TracingExporter.java |  2 +-
 .../sender/urlconnection/URLConnectionSenderExporter.java   |  2 +-
 4 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/exporter/src/main/java/io/zipkin/brave/exporter/AsyncReporterExporter.java b/exporter/src/main/java/io/zipkin/brave/exporter/AsyncReporterExporter.java
index 6d32a38..29d6650 100644
--- a/exporter/src/main/java/io/zipkin/brave/exporter/AsyncReporterExporter.java
+++ b/exporter/src/main/java/io/zipkin/brave/exporter/AsyncReporterExporter.java
@@ -15,14 +15,14 @@ package io.zipkin.brave.exporter;
 
 import java.util.Hashtable;
 import java.util.Map;
+
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.metatype.annotations.Designate;
-import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
 import zipkin2.Span;
 import zipkin2.reporter.AsyncReporter;
 import zipkin2.reporter.Reporter;
@@ -32,7 +32,6 @@ import zipkin2.reporter.Sender;
     immediate = true,
     name = "io.zipkin.asyncreporter"
 )
-@Designate(ocd = AsyncReporterExporter.Config.class)
 public class AsyncReporterExporter {
   @Reference
   Sender sender;
@@ -42,7 +41,7 @@ public class AsyncReporterExporter {
   private ServiceRegistration<Reporter> reg;
 
   @Activate
-  public void activate(Config config, BundleContext context, Map<String, String> properties)
{
+  public void activate(BundleContext context, Map<String, String> properties) {
     reporter = AsyncReporter.builder(sender)
         .build();
     reg = context.registerService(Reporter.class, reporter,
@@ -54,7 +53,4 @@ public class AsyncReporterExporter {
     reg.unregister();
     if (reporter != null) reporter.close();
   }
-
-  @ObjectClassDefinition(name = "AsyncReporter") @interface Config {
-  }
 }
diff --git a/exporter/src/main/java/io/zipkin/brave/exporter/HttpTracingExporter.java b/exporter/src/main/java/io/zipkin/brave/exporter/HttpTracingExporter.java
index be6dcd7..87d700b 100644
--- a/exporter/src/main/java/io/zipkin/brave/exporter/HttpTracingExporter.java
+++ b/exporter/src/main/java/io/zipkin/brave/exporter/HttpTracingExporter.java
@@ -13,24 +13,23 @@
  */
 package io.zipkin.brave.exporter;
 
-import brave.Tracing;
-import brave.http.HttpTracing;
 import java.util.Hashtable;
 import java.util.Map;
+
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.metatype.annotations.Designate;
-import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+import brave.Tracing;
+import brave.http.HttpTracing;
 
 @Component(
     immediate = true,
     name = "io.zipkin.brave.http"
 )
-@Designate(ocd = HttpTracingExporter.Config.class)
 public class HttpTracingExporter {
   @Reference
   Tracing tracing;
@@ -38,7 +37,7 @@ public class HttpTracingExporter {
   private ServiceRegistration<HttpTracing> reg;
 
   @Activate
-  public void activate(Config config, BundleContext context, Map<String, String> properties)
{
+  public void activate(BundleContext context, Map<String, String> properties) {
     HttpTracing httpTracing = HttpTracing.newBuilder(tracing)
         .build();
     reg = context.registerService(HttpTracing.class, httpTracing,
@@ -50,6 +49,4 @@ public class HttpTracingExporter {
     reg.unregister();
   }
 
-  @ObjectClassDefinition(name = "HttpTracing") @interface Config {
-  }
 }
diff --git a/exporter/src/main/java/io/zipkin/brave/exporter/TracingExporter.java b/exporter/src/main/java/io/zipkin/brave/exporter/TracingExporter.java
index eae174d..67e660c 100644
--- a/exporter/src/main/java/io/zipkin/brave/exporter/TracingExporter.java
+++ b/exporter/src/main/java/io/zipkin/brave/exporter/TracingExporter.java
@@ -58,7 +58,7 @@ public class TracingExporter {
     if (tracing != null) tracing.close();
   }
 
-  @ObjectClassDefinition(name = "Tracing") @interface Config {
+  public static @ObjectClassDefinition(name = "Tracing") @interface Config {
     String name() default "unknown";
 
     boolean traceId128Bit() default false;
diff --git a/exporter/src/main/java/io/zipkin/brave/exporter/sender/urlconnection/URLConnectionSenderExporter.java
b/exporter/src/main/java/io/zipkin/brave/exporter/sender/urlconnection/URLConnectionSenderExporter.java
index 78c8b11..1d292eb 100644
--- a/exporter/src/main/java/io/zipkin/brave/exporter/sender/urlconnection/URLConnectionSenderExporter.java
+++ b/exporter/src/main/java/io/zipkin/brave/exporter/sender/urlconnection/URLConnectionSenderExporter.java
@@ -54,7 +54,7 @@ public class URLConnectionSenderExporter {
     if (sender != null) sender.close();
   }
 
-  @ObjectClassDefinition(name = "Zipkin Sender URLConnection") @interface Config {
+  public static @ObjectClassDefinition(name = "Zipkin Sender URLConnection") @interface Config
{
     String endpoint() default "http://localhost:9411/api/v2/spans";
 
     boolean compressionEnabled() default true;


Mime
View raw message