use of com.newrelic.agent.instrumentation.weaver.preprocessors.AgentPreprocessors 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;
}
Aggregations