
com.newrelic.agent.service.module.URLAnalyzer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-agent Show documentation
Show all versions of newrelic-agent Show documentation
Jar required to run with a java application to monitor performance.
The newest version!
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/
package com.newrelic.agent.service.module;
import com.newrelic.api.agent.Logger;
import java.net.URL;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.logging.Level;
public class URLAnalyzer implements Runnable {
private final URL url;
private final Function processor;
private final Consumer analyzedJars;
private final Logger logger;
public URLAnalyzer(URL url, Function processor, Consumer analyzedJars, Logger logger) {
this.url = url;
this.processor = processor;
this.analyzedJars = analyzedJars;
this.logger = logger;
}
@Override
public void run() {
JarData jarData = processor.apply(url);
if (jarData != null) {
logger.log(Level.FINEST, "{0} adding analyzed jar: {1}", url, jarData);
analyzedJars.accept(jarData);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy