@Override public void finish() { scope.close(); }
/** No exceptions are thrown when unbinding a span scope. */ @Override public void close() { scope.close(); }
void noticesDifferentSpanId(Scope scope) { TraceContext differentSpanId = context.toBuilder().spanId(context.spanId() + 1L).build(); try (Scope scope2 = currentTraceContext.maybeScope(differentSpanId)) { assertThat(scope2).isNotEqualTo(Scope.NOOP); assertThat(currentTraceContext.get()) .isEqualTo(differentSpanId); verifyImplicitContext(differentSpanId); } finally { scope.close(); } }
@Override public void finish() { scope.close(); if (!pendingSpans.remove(context)) return; // don't double-report state.finishTimestamp(clock.currentTimeMicroseconds()); finishedSpanHandler.handle(context, state); }
@Override public void process(HttpRequest request, HttpContext context) { Scope scope = (Scope) context.getAttribute(Scope.class.getName()); if (scope == null) return; context.removeAttribute(Scope.class.getName()); scope.close(); } }
void noticesDifferentContext(Scope scope) { try (Scope scope2 = currentTraceContext.maybeScope(context2)) { assertThat(scope2).isNotEqualTo(Scope.NOOP); assertThat(currentTraceContext.get()) .isEqualTo(context2); verifyImplicitContext(context2); } finally { scope.close(); } }
void retainsContext(Scope scope) { try { assertThat(scope).isNotEqualTo(Scope.NOOP); assertThat(currentTraceContext.get()) .isEqualTo(context); verifyImplicitContext(context); } finally { scope.close(); } }
@Override public void close() { if (Thread.currentThread().getId() != threadId) { throw new IllegalStateException( "scope closed in a different thread: " + Thread.currentThread().getName(), caller); } delegate.close(); }
@Override public void finish() { scope.close(); }
/** No exceptions are thrown when unbinding a span scope. */ @Override public void close() { scope.close(); }
@Override public void onError(Throwable t) { if (done) { RxJavaPlugins.onError(t); return; } done = true; Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally downstream.onError(t); } finally { scope.close(); } }
void handleFinish(@Nullable Resp response, @Nullable Throwable error, Span span) { if (span.isNoop()) return; try { Scope ws = currentTraceContext.maybeScope(span.context()); try { parser.response(adapter, response, error, span.customizer()); } finally { ws.close(); // close the scope before finishing the span } } finally { finishInNullScope(span); } }
@TearDown public void closeScope() { log4j2Scope.close(); }
@Override public void onError(Throwable t) { if (done) { RxJavaPlugins.onError(t); return; } done = true; Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally downstream.onError(t); } finally { scope.close(); } }
@Override public void onComplete() { if (done) return; done = true; Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally downstream.onComplete(); } finally { scope.close(); } }
void retainsContext(Scope scope) { try { assertThat(scope).isNotEqualTo(Scope.NOOP); assertThat(currentTraceContext.get()) .isEqualTo(context); verifyImplicitContext(context); } finally { scope.close(); } }
@Override public void connect(Consumer<? super Disposable> connection) { Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally source.connect(connection); } finally { scope.close(); } } }
@Override public void onSuccess(T value) { Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally downstream.onSuccess(value); } finally { scope.close(); } }
@Override public void connect(Consumer<? super Disposable> connection) { Scope scope = contextScoper.maybeScope(assembled); try { // retrolambda can't resolve this try/finally source.connect(connection); } finally { scope.close(); } } }