You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/06/04 15:07:41 UTC
cxf git commit: [CXF-6360] Moving HTraceTracerContext into a diff
package
Repository: cxf
Updated Branches:
refs/heads/master 38d3b4214 -> c2b70fd46
[CXF-6360] Moving HTraceTracerContext into a diff package
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c2b70fd4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c2b70fd4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c2b70fd4
Branch: refs/heads/master
Commit: c2b70fd462955b714f0211ff52e1f99399666d44
Parents: 38d3b42
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Thu Jun 4 14:07:23 2015 +0100
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Thu Jun 4 14:07:23 2015 +0100
----------------------------------------------------------------------
.../tracing/htrace/HTraceContextProvider.java | 1 +
.../tracing/htrace/HTraceTracerContext.java | 77 --------------------
.../cxf/tracing/htrace/HTraceTracerContext.java | 77 ++++++++++++++++++++
3 files changed, 78 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/c2b70fd4/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceContextProvider.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceContextProvider.java b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceContextProvider.java
index c983f1d..12abac9 100644
--- a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceContextProvider.java
+++ b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceContextProvider.java
@@ -23,6 +23,7 @@ import javax.ws.rs.ext.Provider;
import org.apache.cxf.jaxrs.ext.ContextProvider;
import org.apache.cxf.message.Message;
import org.apache.cxf.tracing.TracerContext;
+import org.apache.cxf.tracing.htrace.HTraceTracerContext;
import org.apache.htrace.Sampler;
import org.apache.htrace.impl.NeverSampler;
http://git-wip-us.apache.org/repos/asf/cxf/blob/c2b70fd4/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceTracerContext.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceTracerContext.java b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceTracerContext.java
deleted file mode 100644
index 5694795..0000000
--- a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/jaxrs/tracing/htrace/HTraceTracerContext.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.jaxrs.tracing.htrace;
-
-import java.nio.charset.StandardCharsets;
-import java.util.concurrent.Callable;
-
-import org.apache.cxf.tracing.Traceable;
-import org.apache.cxf.tracing.TracerContext;
-import org.apache.htrace.Sampler;
-import org.apache.htrace.Trace;
-import org.apache.htrace.TraceScope;
-import org.apache.htrace.wrappers.TraceCallable;
-
-public class HTraceTracerContext implements TracerContext {
- private final Sampler< ? > sampler;
-
- public HTraceTracerContext(final Sampler< ? > sampler) {
- this.sampler = sampler;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public TraceScope startSpan(final String description) {
- return Trace.startSpan(description, sampler);
- }
-
- @Override
- public <T> Callable<T> wrap(final String desription, final Traceable<T> traceable) {
- final Callable<T> callable = new Callable<T>() {
- @Override
- public T call() throws Exception {
- return traceable.call(new HTraceTracerContext(sampler));
- }
- };
-
- // TODO: Replace with HTrace's wrap() method once the version with
- // callable and description becomes available.
- if (Trace.isTracing()) {
- return new TraceCallable<T>(Trace.currentSpan(), callable, desription);
- } else {
- return callable;
- }
- }
-
- @Override
- public void annotate(byte[] key, byte[] value) {
- Trace.addKVAnnotation(key, value);
- }
-
- @Override
- public void annotate(String key, String value) {
- annotate(key.getBytes(StandardCharsets.UTF_8),
- value.getBytes(StandardCharsets.UTF_8));
- }
-
- @Override
- public void timeline(String message) {
- Trace.addTimelineAnnotation(message);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/c2b70fd4/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/HTraceTracerContext.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/HTraceTracerContext.java b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/HTraceTracerContext.java
new file mode 100644
index 0000000..2e92435
--- /dev/null
+++ b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/HTraceTracerContext.java
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.tracing.htrace;
+
+import java.nio.charset.StandardCharsets;
+import java.util.concurrent.Callable;
+
+import org.apache.cxf.tracing.Traceable;
+import org.apache.cxf.tracing.TracerContext;
+import org.apache.htrace.Sampler;
+import org.apache.htrace.Trace;
+import org.apache.htrace.TraceScope;
+import org.apache.htrace.wrappers.TraceCallable;
+
+public class HTraceTracerContext implements TracerContext {
+ private final Sampler< ? > sampler;
+
+ public HTraceTracerContext(final Sampler< ? > sampler) {
+ this.sampler = sampler;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public TraceScope startSpan(final String description) {
+ return Trace.startSpan(description, sampler);
+ }
+
+ @Override
+ public <T> Callable<T> wrap(final String desription, final Traceable<T> traceable) {
+ final Callable<T> callable = new Callable<T>() {
+ @Override
+ public T call() throws Exception {
+ return traceable.call(new HTraceTracerContext(sampler));
+ }
+ };
+
+ // TODO: Replace with HTrace's wrap() method once the version with
+ // callable and description becomes available.
+ if (Trace.isTracing()) {
+ return new TraceCallable<T>(Trace.currentSpan(), callable, desription);
+ } else {
+ return callable;
+ }
+ }
+
+ @Override
+ public void annotate(byte[] key, byte[] value) {
+ Trace.addKVAnnotation(key, value);
+ }
+
+ @Override
+ public void annotate(String key, String value) {
+ annotate(key.getBytes(StandardCharsets.UTF_8),
+ value.getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public void timeline(String message) {
+ Trace.addTimelineAnnotation(message);
+ }
+}