Search in sources :

Example 1 with JarProfilerPluginClassInjector

use of com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector in project pinpoint by naver.

the class ProfilerPluginLoader method load.

public List<SetupResult> load(URL[] pluginJars) {
    List<SetupResult> pluginContexts = new ArrayList<SetupResult>(pluginJars.length);
    for (URL pluginJar : pluginJars) {
        final JarFile pluginJarFile = createJarFile(pluginJar);
        final List<String> pluginPackageList = getPluginPackage(pluginJarFile);
        final ClassNameFilter pluginFilterChain = createPluginFilterChain(pluginPackageList);
        final List<ProfilerPlugin> original = PluginLoader.load(ProfilerPlugin.class, new URL[] { pluginJar });
        List<ProfilerPlugin> plugins = filterDisablePlugin(original);
        for (ProfilerPlugin plugin : plugins) {
            if (logger.isInfoEnabled()) {
                logger.info("{} Plugin {}:{}", plugin.getClass(), PluginConfig.PINPOINT_PLUGIN_PACKAGE, pluginPackageList);
            }
            logger.info("Loading plugin:{} pluginPackage:{}", plugin.getClass().getName(), plugin);
            PluginConfig pluginConfig = new PluginConfig(pluginJar, pluginFilterChain);
            final ClassInjector classInjector = new JarProfilerPluginClassInjector(pluginConfig, instrumentEngine);
            final SetupResult result = pluginSetup.setupPlugin(plugin, classInjector);
            pluginContexts.add(result);
        }
    }
    return pluginContexts;
}
Also used : ArrayList(java.util.ArrayList) ProfilerPlugin(com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin) JarFile(java.util.jar.JarFile) URL(java.net.URL) JarProfilerPluginClassInjector(com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector) ClassInjector(com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector) JarProfilerPluginClassInjector(com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector)

Aggregations

ProfilerPlugin (com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin)1 ClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector)1 JarProfilerPluginClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 JarFile (java.util.jar.JarFile)1