/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.contrib.staticinstrumenter.extension;

import com.google.auto.service.AutoService;
import io.opentelemetry.instrumentation.api.config.Config;
import io.opentelemetry.javaagent.extension.AgentListener;
import io.opentelemetry.javaagent.tooling.HelperInjector;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;

/**
 * Configures a listener on {@link io.opentelemetry.javaagent.tooling.HelperInjector} before the
 * agents starts. The listener enables passing additional classes created by the agent to the static
 * instrumenter, which in turn saves them into the app jar.
 */
@AutoService(AgentListener.class)
public class AdditionalClassesInjectorListenerInstaller implements AgentListener {

  @Override
  public void beforeAgent(
      Config config, AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
    HelperInjector.setHelperInjectorListener(new AdditionalClassesInjectorListener());
  }
}

@@ -284,18 +284,22 @@
 ent.
-extension.
+tooling.Before
 Agen
@@ -721,16 +721,22 @@
 Service(
+Before
 AgentLis
@@ -815,16 +815,22 @@
 lements 
+Before
 AgentLis

Fix deprecated AgentListener.beforeAgent usage (#332)