1 /* 2 * Copyright 2017, OpenCensus Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package io.opencensus.trace; 18 19 import io.opencensus.common.Clock; 20 import io.opencensus.implcore.common.MillisClock; 21 import io.opencensus.implcore.internal.SimpleEventQueue; 22 import io.opencensus.implcore.trace.TraceComponentImplBase; 23 import io.opencensus.implcore.trace.internal.RandomHandler.SecureRandomHandler; 24 import io.opencensus.trace.config.TraceConfig; 25 import io.opencensus.trace.export.ExportComponent; 26 import io.opencensus.trace.propagation.PropagationComponent; 27 28 /** Android-compatible implementation of the {@link TraceComponent}. */ 29 // TraceComponentImplLite was moved to io.opencensus.impllite.trace. This class exists for backwards 30 // compatibility, so that it can be loaded by opencensus-api 0.5. 31 @Deprecated 32 public final class TraceComponentImplLite extends TraceComponent { 33 private final TraceComponentImplBase traceComponentImplBase; 34 35 /** Public constructor to be used with reflection loading. */ TraceComponentImplLite()36 public TraceComponentImplLite() { 37 traceComponentImplBase = 38 new TraceComponentImplBase( 39 MillisClock.getInstance(), new SecureRandomHandler(), new SimpleEventQueue()); 40 } 41 42 @Override getTracer()43 public Tracer getTracer() { 44 return traceComponentImplBase.getTracer(); 45 } 46 47 @Override getPropagationComponent()48 public PropagationComponent getPropagationComponent() { 49 return traceComponentImplBase.getPropagationComponent(); 50 } 51 52 @Override getClock()53 public Clock getClock() { 54 return traceComponentImplBase.getClock(); 55 } 56 57 @Override getExportComponent()58 public ExportComponent getExportComponent() { 59 return traceComponentImplBase.getExportComponent(); 60 } 61 62 @Override getTraceConfig()63 public TraceConfig getTraceConfig() { 64 return traceComponentImplBase.getTraceConfig(); 65 } 66 } 67