Skip to content

Commit 984f8d2

Browse files
committed
Renaming advice scope types
1 parent cd7c7b7 commit 984f8d2

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/ClientCallableRpcInstrumentation.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,19 @@ public void transform(TypeTransformer transformer) {
4141
@SuppressWarnings("unused")
4242
public static class InvokeMethodAdvice {
4343

44-
public static class InvokeMethodAdviceScope {
44+
public static class AdviceScope {
4545
private final VaadinClientCallableRequest request;
4646
private final Context context;
4747
private final Scope scope;
4848

49-
private InvokeMethodAdviceScope(
50-
VaadinClientCallableRequest request, Context context, Scope scope) {
49+
private AdviceScope(VaadinClientCallableRequest request, Context context, Scope scope) {
5150
this.request = request;
5251
this.context = context;
5352
this.scope = scope;
5453
}
5554

5655
@Nullable
57-
public static InvokeMethodAdviceScope start(Class<?> componentClass, String methodName) {
56+
public static AdviceScope start(Class<?> componentClass, String methodName) {
5857
Context parentContext = Context.current();
5958
VaadinClientCallableRequest request =
6059
VaadinClientCallableRequest.create(componentClass, methodName);
@@ -64,7 +63,7 @@ public static InvokeMethodAdviceScope start(Class<?> componentClass, String meth
6463

6564
Context context = clientCallableInstrumenter().start(parentContext, request);
6665
Scope scope = context.makeCurrent();
67-
return new InvokeMethodAdviceScope(request, context, scope);
66+
return new AdviceScope(request, context, scope);
6867
}
6968

7069
public void end(@Nullable Throwable throwable) {
@@ -76,15 +75,15 @@ public void end(@Nullable Throwable throwable) {
7675

7776
@Nullable
7877
@Advice.OnMethodEnter(suppress = Throwable.class)
79-
public static InvokeMethodAdviceScope onEnter(
78+
public static AdviceScope onEnter(
8079
@Advice.Argument(1) Class<?> componentClass, @Advice.Argument(2) String methodName) {
81-
return InvokeMethodAdviceScope.start(componentClass, methodName);
80+
return AdviceScope.start(componentClass, methodName);
8281
}
8382

8483
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
8584
public static void onExit(
8685
@Advice.Thrown @Nullable Throwable throwable,
87-
@Advice.Enter @Nullable InvokeMethodAdviceScope adviceScope) {
86+
@Advice.Enter @Nullable AdviceScope adviceScope) {
8887
if (adviceScope == null) {
8988
return;
9089
}

instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/RequestHandlerInstrumentation.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,26 @@ public void transform(TypeTransformer transformer) {
4646

4747
@SuppressWarnings("unused")
4848
public static class HandleRequestAdvice {
49-
public static class HandleRequestAdviceScope {
49+
public static class AdviceScope {
5050
private final VaadinHandlerRequest request;
5151
private final Context context;
5252
private final Scope scope;
5353

54-
private HandleRequestAdviceScope(VaadinHandlerRequest request, Context context, Scope scope) {
54+
private AdviceScope(VaadinHandlerRequest request, Context context, Scope scope) {
5555
this.request = request;
5656
this.context = context;
5757
this.scope = scope;
5858
}
5959

6060
@Nullable
61-
public static HandleRequestAdviceScope start(Class<?> handlerClass, String methodName) {
61+
public static AdviceScope start(Class<?> handlerClass, String methodName) {
6262
VaadinHandlerRequest request = VaadinHandlerRequest.create(handlerClass, methodName);
6363
Context context = helper().startRequestHandlerSpan(request);
6464
if (context == null) {
6565
return null;
6666
}
6767
Scope scope = context.makeCurrent();
68-
return new HandleRequestAdviceScope(request, context, scope);
68+
return new AdviceScope(request, context, scope);
6969
}
7070

7171
public void end(@Nullable Throwable throwable, boolean handled) {
@@ -77,17 +77,17 @@ public void end(@Nullable Throwable throwable, boolean handled) {
7777

7878
@Nullable
7979
@Advice.OnMethodEnter(suppress = Throwable.class)
80-
public static HandleRequestAdviceScope onEnter(
80+
public static AdviceScope onEnter(
8181
@Advice.This RequestHandler requestHandler, @Advice.Origin("#m") String methodName) {
8282

83-
return HandleRequestAdviceScope.start(requestHandler.getClass(), methodName);
83+
return AdviceScope.start(requestHandler.getClass(), methodName);
8484
}
8585

8686
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
8787
public static void onExit(
8888
@Advice.Thrown Throwable throwable,
8989
@Advice.Return boolean handled,
90-
@Advice.Enter @Nullable HandleRequestAdviceScope adviceScope) {
90+
@Advice.Enter @Nullable AdviceScope adviceScope) {
9191
if (adviceScope == null) {
9292
return;
9393
}

instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/RpcInvocationHandlerInstrumentation.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ public void transform(TypeTransformer transformer) {
4848
@SuppressWarnings("unused")
4949
public static class HandleAdvice {
5050

51-
public static class HandleAdviceScope {
51+
public static class AdviceScope {
5252
private final VaadinRpcRequest request;
5353
private final Context context;
5454
private final Scope scope;
5555

56-
private HandleAdviceScope(VaadinRpcRequest request, Context context, Scope scope) {
56+
private AdviceScope(VaadinRpcRequest request, Context context, Scope scope) {
5757
this.request = request;
5858
this.context = context;
5959
this.scope = scope;
6060
}
6161

6262
@Nullable
63-
public static HandleAdviceScope start(
63+
public static AdviceScope start(
6464
RpcInvocationHandler handler, String methodName, JsonObject jsonObject) {
6565
Context parentContext = Context.current();
6666
VaadinRpcRequest request = VaadinRpcRequest.create(handler, methodName, jsonObject);
@@ -70,7 +70,7 @@ public static HandleAdviceScope start(
7070

7171
Context context = rpcInstrumenter().start(parentContext, request);
7272
Scope scope = context.makeCurrent();
73-
return new HandleAdviceScope(request, context, scope);
73+
return new AdviceScope(request, context, scope);
7474
}
7575

7676
public void end(@Nullable Throwable throwable) {
@@ -82,17 +82,17 @@ public void end(@Nullable Throwable throwable) {
8282

8383
@Nullable
8484
@Advice.OnMethodEnter(suppress = Throwable.class)
85-
public static HandleAdviceScope onEnter(
85+
public static AdviceScope onEnter(
8686
@Advice.This RpcInvocationHandler rpcInvocationHandler,
8787
@Advice.Origin("#m") String methodName,
8888
@Advice.Argument(1) JsonObject jsonObject) {
89-
return HandleAdviceScope.start(rpcInvocationHandler, methodName, jsonObject);
89+
return AdviceScope.start(rpcInvocationHandler, methodName, jsonObject);
9090
}
9191

9292
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
9393
public static void onExit(
9494
@Advice.Thrown @Nullable Throwable throwable,
95-
@Advice.Enter @Nullable HandleAdviceScope adviceScope) {
95+
@Advice.Enter @Nullable AdviceScope adviceScope) {
9696
if (adviceScope == null) {
9797
return;
9898
}

instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinServiceInstrumentation.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,26 @@ public void transform(TypeTransformer transformer) {
3939
@SuppressWarnings("unused")
4040
public static class HandleRequestAdvice {
4141

42-
public static class HandleRequestAdviceScope {
42+
public static class AdviceScope {
4343
private final VaadinServiceRequest request;
4444
private final Context context;
4545
private final Scope scope;
4646

47-
private HandleRequestAdviceScope(VaadinServiceRequest request, Context context, Scope scope) {
47+
private AdviceScope(VaadinServiceRequest request, Context context, Scope scope) {
4848
this.request = request;
4949
this.context = context;
5050
this.scope = scope;
5151
}
5252

5353
@Nullable
54-
public static HandleRequestAdviceScope start(Class<?> serviceClass, String methodName) {
54+
public static AdviceScope start(Class<?> serviceClass, String methodName) {
5555
VaadinServiceRequest request = VaadinServiceRequest.create(serviceClass, methodName);
5656
Context context = helper().startVaadinServiceSpan(request);
5757
if (context == null) {
5858
return null;
5959
}
6060
Scope scope = context.makeCurrent();
61-
return new HandleRequestAdviceScope(request, context, scope);
61+
return new AdviceScope(request, context, scope);
6262
}
6363

6464
public void end(@Nullable Throwable throwable) {
@@ -70,16 +70,16 @@ public void end(@Nullable Throwable throwable) {
7070

7171
@Nullable
7272
@Advice.OnMethodEnter(suppress = Throwable.class)
73-
public static HandleRequestAdviceScope onEnter(
73+
public static AdviceScope onEnter(
7474
@Advice.This VaadinService vaadinService, @Advice.Origin("#m") String methodName) {
7575

76-
return HandleRequestAdviceScope.start(vaadinService.getClass(), methodName);
76+
return AdviceScope.start(vaadinService.getClass(), methodName);
7777
}
7878

7979
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
8080
public static void onExit(
8181
@Advice.Thrown @Nullable Throwable throwable,
82-
@Advice.Enter @Nullable HandleRequestAdviceScope adviceScope) {
82+
@Advice.Enter @Nullable AdviceScope adviceScope) {
8383
if (adviceScope == null) {
8484
return;
8585
}

0 commit comments

Comments
 (0)