void closeScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't close TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } if (tracerPool == null) { throwClientError(toString() + " is closed."); } SpanReceiver[] receivers = tracerPool.getReceivers(); if (receivers == null) { throwClientError(toString() + " is closed."); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); scope.setParent(null); Span span = scope.getSpan(); span.stop(); for (SpanReceiver receiver : receivers) { receiver.receiveSpan(span); } }
void closeScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't close TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } if (tracerPool == null) { throwClientError(toString() + " is closed."); } SpanReceiver[] receivers = tracerPool.getReceivers(); if (receivers == null) { throwClientError(toString() + " is closed."); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); scope.setParent(null); Span span = scope.getSpan(); span.stop(); for (SpanReceiver receiver : receivers) { receiver.receiveSpan(span); } }
void closeScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't close TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } if (tracerPool == null) { throwClientError(toString() + " is closed."); } SpanReceiver[] receivers = tracerPool.getReceivers(); if (receivers == null) { throwClientError(toString() + " is closed."); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); scope.setParent(null); Span span = scope.getSpan(); span.stop(); for (SpanReceiver receiver : receivers) { receiver.receiveSpan(span); } }