Skip to content

Commit

Permalink
Move SharedCommunicationObjects creation to InstallDatadogTracerCallb…
Browse files Browse the repository at this point in the history
…ack constructor
  • Loading branch information
mcculls committed Dec 28, 2024
1 parent 92ca151 commit 40c7583
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,22 +499,13 @@ public void execute() {
protected static class InstallDatadogTracerCallback extends ClassLoadCallBack {
private final InitializationTelemetry initTelemetry;
private final Instrumentation instrumentation;
private final Object sco;
private final Class<?> scoClass;

public InstallDatadogTracerCallback(
InitializationTelemetry initTelemetry, Instrumentation instrumentation) {
this.initTelemetry = initTelemetry;
this.instrumentation = instrumentation;
}

@Override
public AgentThread agentThread() {
return TRACE_STARTUP;
}

@Override
public void execute() {
Object sco;
Class<?> scoClass;
try {
scoClass =
AGENT_CLASSLOADER.loadClass("datadog.communication.ddagent.SharedCommunicationObjects");
Expand All @@ -526,7 +517,15 @@ public void execute() {
| InvocationTargetException e) {
throw new UndeclaredThrowableException(e);
}
}

@Override
public AgentThread agentThread() {
return TRACE_STARTUP;
}

@Override
public void execute() {
installDatadogTracer(initTelemetry, scoClass, sco);
maybeStartAppSec(scoClass, sco);
maybeStartIast(instrumentation, scoClass, sco);
Expand Down

0 comments on commit 40c7583

Please sign in to comment.