use of com.newrelic.weave.weavepackage.WeavePackageConfig 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;
}
use of com.newrelic.weave.weavepackage.WeavePackageConfig in project newrelic-java-agent by newrelic.
the class WeavePackageAnalyzer method run.
@Override
public void run() {
WeavePackageConfig weaveConfig;
try {
weaveConfig = WeavePackageConfig.builder().url(file.toURI().toURL()).build();
} catch (Exception e) {
logger.log(Level.FINEST, e, "{0} failed to build weave config for file");
return;
}
JarData jarData = getWeaveJar(file, weaveConfig);
logger.log(Level.FINEST, "{0} adding analyzed jar from weave package: {1}", file, jarData);
analyzedJars.accept(jarData);
}
Aggregations