com.newrelic.weave.weavepackage.language.LanguageAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-weaver Show documentation
Show all versions of newrelic-weaver Show documentation
The Weaver of the Java agent.
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/
package com.newrelic.weave.weavepackage.language;
import java.util.List;
/**
* A language adapter has a chance to process the input bytes before they are handed to the WeavePackage.
* This allows other JVM languages to define their own weaver api by doing the following:
*
* - Extending the weaver api to suite the language of choice
* - Using {@link LanguageAdapter#adapt(List)}, translate the input bytes into bytes the Java api can process. This
* transformation can be defined by the extended api defined in the previous step.
* - Raise any desired custom violations in the returned {@link LanguageAdapterResult}
*
*/
public interface LanguageAdapter {
/**
* The adapt method will be called before the weave package processes the instrumentation bytes.
*
* @param input bytes read from disk
* @return A {@link LanguageAdapterResult} containing the output bytes and any violations found by the adapter.
*/
public LanguageAdapterResult adapt(List input);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy