Search in sources :

Example 1 with AgentPostprocessors

use of com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPostprocessors in project newrelic-java-agent by newrelic.

the class ClassWeaverService method createWeavePackageConfig.

private WeavePackageConfig createWeavePackageConfig(JarInputStream jarStream, String source, Instrumentation instrumentation, WeavePackageType type, AgentConfig agentConfig) throws Exception {
    AgentPreprocessors preprocessors = new AgentPreprocessors(agentConfig, tracedWeaveInstrumentationDetails);
    AgentPostprocessors postprocessors = new AgentPostprocessors();
    WeavePackageConfig result = WeavePackageConfig.builder().source(source).jarInputStream(jarStream).weavePreprocessor(preprocessors).weavePostprocessor(postprocessors).errorHandleClassNode(LogAndReturnOriginal.ERROR_HANDLER_NODE).extensionClassTemplate(EXTENSION_TEMPLATE).build();
    preprocessors.setInstrumentationTitle(result.getName());
    if (result.getVendorId() != null) {
        // Set the type to "FIELD" for FIT modules. Otherwise this will already be set to INTERNAL or CUSTOM
        type = WeavePackageType.FIELD;
    }
    postprocessors.setWeavePackageType(type);
    return result;
}
Also used : WeavePackageConfig(com.newrelic.weave.weavepackage.WeavePackageConfig) AgentPreprocessors(com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPreprocessors) AgentPostprocessors(com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPostprocessors)

Aggregations

AgentPostprocessors (com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPostprocessors)1 AgentPreprocessors (com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPreprocessors)1 WeavePackageConfig (com.newrelic.weave.weavepackage.WeavePackageConfig)1