@Test void shouldProxyScopeManager() { final ScopeManager manager = unit.scopeManager(); final Span test = unit.buildSpan("test").start(); try (final Scope ignored = manager.activate(test)) { manager.activeSpan().setOperationName("GET"); } finally { test.finish(); } final MockSpan span = getOnlyElement(tracer.finishedSpans()); assertEquals("get", span.operationName()); }
@Override public Scope activate(@Nullable final Span span) { if (span == null) { return ForwardingScopeManager.super.activate(null); } final Scope original = ForwardingScopeManager.super.activate(span); final ProxyScope scope = new ProxyScope(original, span, plugins); plugins.listeners().scopes().onActivated(scope, span); return scope; }
ProxyScopeManager implements ForwardingScopeManager { @Override public Scope activate(@Nullable final Span span) { if (span == null) { return ForwardingScopeManager.super.activate(null); } final Scope original = ForwardingScopeManager.super.activate(span); final ProxyScope scope = new ProxyScope(original, span, plugins); plugins.listeners().scopes().onActivated(scope, span); return scope; } }
ProxyScopeManager implements ForwardingScopeManager { @Override public Scope activate(@Nullable final Span span) { if (span == null) { return ForwardingScopeManager.super.activate(null); } final Scope original = ForwardingScopeManager.super.activate(span); final ProxyScope scope = new ProxyScope(original, span, plugins); plugins.listeners().scopes().onActivated(scope, span); return scope; }  }
ProxyScopeManager implements ForwardingScopeManager { @Override public Scope activate(@Nullable final Span span) { if (span == null) { return ForwardingScopeManager.super.activate(null); } final Scope original = ForwardingScopeManager.super.activate(span); final ProxyScope scope = new ProxyScope(original, span, plugins); plugins.listeners().scopes().onActivated(scope, span); return scope; }  @Override ScopeManager delegate(); @Override Scope activate(@Nullable final Span span); }
ProxyScopeManager implements ForwardingScopeManager { @Override public Scope activate(@Nullable final Span span) { if (span == null) { return ForwardingScopeManager.super.activate(null); } final Scope original = ForwardingScopeManager.super.activate(span); final ProxyScope scope = new ProxyScope(original, span, plugins); plugins.listeners().scopes().onActivated(scope, span); return scope; }  @Override ScopeManager delegate(); @Override Scope activate(@Nullable final Span span);  }