aboutsummaryrefslogtreecommitdiff
path: root/impl_lite
diff options
context:
space:
mode:
authorKristen Kozak <sebright@google.com>2017-08-15 13:45:20 -0700
committerKristen Kozak <sebright@google.com>2017-08-16 13:35:35 -0700
commit3b5ec6e482575bd6be1572c7ef65c7b7ab832320 (patch)
tree633273071f5234a31b75f8424e88b41631cbfee0 /impl_lite
parent54daf8a784ee649911eae850fd55e0506fadd5a6 (diff)
downloadopencensus-java-3b5ec6e482575bd6be1572c7ef65c7b7ab832320.tar.gz
Move tracing implementation classes to io.opencensus.impl.trace.
This is part of #379. The package name may still need to be changed again, but this commit includes all of the changes necessary to put the API and implementation in separate packages. Other changes in this commit: - Make TraceComponent's constructor public. - Leave deprecated copies of the TraceComponent subclasses in the io.opencensus.trace package so that they can be loaded by opencensus-api 0.5. - Move internal classes to io.opencensus.impl.internal. - Make TraceComponentImplBase and BinaryFormatImpl public.
Diffstat (limited to 'impl_lite')
-rw-r--r--impl_lite/src/main/java/io/opencensus/impl/trace/TraceComponentImplLite.java27
-rw-r--r--impl_lite/src/main/java/io/opencensus/trace/TraceComponentImplLite.java10
-rw-r--r--impl_lite/src/test/java/io/opencensus/impl/trace/TraceComponentImplLiteTest.java (renamed from impl_lite/src/test/java/io/opencensus/trace/TraceComponentImplLiteTest.java)9
3 files changed, 39 insertions, 7 deletions
diff --git a/impl_lite/src/main/java/io/opencensus/impl/trace/TraceComponentImplLite.java b/impl_lite/src/main/java/io/opencensus/impl/trace/TraceComponentImplLite.java
new file mode 100644
index 00000000..7b172279
--- /dev/null
+++ b/impl_lite/src/main/java/io/opencensus/impl/trace/TraceComponentImplLite.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2017, Google Inc.
+ * Licensed 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 io.opencensus.impl.trace;
+
+import io.opencensus.impl.common.MillisClock;
+import io.opencensus.impl.internal.SimpleEventQueue;
+import io.opencensus.impl.trace.internal.RandomHandler.SecureRandomHandler;
+import io.opencensus.trace.TraceComponent;
+
+/** Android-compatible implementation of the {@link TraceComponent}. */
+public final class TraceComponentImplLite extends TraceComponentImplBase {
+
+ public TraceComponentImplLite() {
+ super(MillisClock.getInstance(), new SecureRandomHandler(), new SimpleEventQueue());
+ }
+}
diff --git a/impl_lite/src/main/java/io/opencensus/trace/TraceComponentImplLite.java b/impl_lite/src/main/java/io/opencensus/trace/TraceComponentImplLite.java
index c3d7100b..38a49927 100644
--- a/impl_lite/src/main/java/io/opencensus/trace/TraceComponentImplLite.java
+++ b/impl_lite/src/main/java/io/opencensus/trace/TraceComponentImplLite.java
@@ -13,11 +13,15 @@
package io.opencensus.trace;
-import io.opencensus.common.MillisClock;
-import io.opencensus.internal.SimpleEventQueue;
-import io.opencensus.trace.internal.RandomHandler.SecureRandomHandler;
+import io.opencensus.impl.common.MillisClock;
+import io.opencensus.impl.internal.SimpleEventQueue;
+import io.opencensus.impl.trace.TraceComponentImplBase;
+import io.opencensus.impl.trace.internal.RandomHandler.SecureRandomHandler;
/** Android-compatible implementation of the {@link TraceComponent}. */
+// TraceComponentImplLite was moved to io.opencensus.impl.trace. This class exists for backwards
+// compatibility, so that it can be loaded by opencensus-api O.5.
+@Deprecated
public final class TraceComponentImplLite extends TraceComponentImplBase {
public TraceComponentImplLite() {
diff --git a/impl_lite/src/test/java/io/opencensus/trace/TraceComponentImplLiteTest.java b/impl_lite/src/test/java/io/opencensus/impl/trace/TraceComponentImplLiteTest.java
index f06c3d40..c07e0683 100644
--- a/impl_lite/src/test/java/io/opencensus/trace/TraceComponentImplLiteTest.java
+++ b/impl_lite/src/test/java/io/opencensus/impl/trace/TraceComponentImplLiteTest.java
@@ -11,13 +11,14 @@
* limitations under the License.
*/
-package io.opencensus.trace;
+package io.opencensus.impl.trace;
import static com.google.common.truth.Truth.assertThat;
-import io.opencensus.common.MillisClock;
-import io.opencensus.trace.export.ExportComponentImpl;
-import io.opencensus.trace.propagation.PropagationComponentImpl;
+import io.opencensus.impl.common.MillisClock;
+import io.opencensus.impl.trace.export.ExportComponentImpl;
+import io.opencensus.impl.trace.propagation.PropagationComponentImpl;
+import io.opencensus.trace.Tracing;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;