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 27, 2024
1 parent 71886d7 commit 4709f62
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,22 +498,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 @@ -525,7 +516,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 4709f62

Please sign in to comment.