Search in sources :

Example 1 with SetupResult

use of com.navercorp.pinpoint.profiler.plugin.SetupResult in project pinpoint by naver.

the class MockPluginContextLoadResult method load.

private List<SetupResult> load() {
    List<ProfilerPlugin> plugins = PluginLoader.load(ProfilerPlugin.class, ClassLoader.getSystemClassLoader());
    List<SetupResult> pluginContexts = new ArrayList<SetupResult>();
    ClassInjector classInjector = new TestProfilerPluginClassLoader();
    PluginSetup pluginSetup = new MockPluginSetup(profilerConfig, instrumentEngine, dynamicTransformTrigger);
    for (ProfilerPlugin plugin : plugins) {
        SetupResult context = pluginSetup.setupPlugin(plugin, classInjector);
        pluginContexts.add(context);
    }
    return pluginContexts;
}
Also used : SetupResult(com.navercorp.pinpoint.profiler.plugin.SetupResult) PluginSetup(com.navercorp.pinpoint.profiler.plugin.PluginSetup) ArrayList(java.util.ArrayList) ProfilerPlugin(com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin) ClassInjector(com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector)

Example 2 with SetupResult

use of com.navercorp.pinpoint.profiler.plugin.SetupResult in project pinpoint by naver.

the class MockPluginContextLoadResult method getClassFileTransformer.

@Override
public List<ClassFileTransformer> getClassFileTransformer() {
    List<ClassFileTransformer> classFileTransformerList = new ArrayList<ClassFileTransformer>();
    for (SetupResult pluginContext : getProfilerPluginContextList()) {
        List<ClassFileTransformer> classFileTransformer = pluginContext.getClassTransformerList();
        classFileTransformerList.addAll(classFileTransformer);
    }
    return classFileTransformerList;
}
Also used : ClassFileTransformer(java.lang.instrument.ClassFileTransformer) SetupResult(com.navercorp.pinpoint.profiler.plugin.SetupResult) ArrayList(java.util.ArrayList)

Example 3 with SetupResult

use of com.navercorp.pinpoint.profiler.plugin.SetupResult in project pinpoint by naver.

the class MockPluginSetup method setupPlugin.

@Override
public SetupResult setupPlugin(ProfilerPlugin plugin, ClassInjector classInjector) {
    final DefaultProfilerPluginSetupContext pluginSetupContext = new DefaultProfilerPluginSetupContext(profilerConfig);
    final GuardProfilerPluginContext guardPluginSetupContext = new GuardProfilerPluginContext(pluginSetupContext);
    ClassFileTransformerLoader classFileTransformerLoader = new ClassFileTransformerLoader(profilerConfig, dynamicTransformTrigger);
    InstrumentContext instrumentContext = new PluginInstrumentContext(profilerConfig, instrumentEngine, dynamicTransformTrigger, classInjector, classFileTransformerLoader);
    try {
        preparePlugin(plugin, instrumentContext);
        plugin.setup(guardPluginSetupContext);
    } finally {
        guardPluginSetupContext.close();
    }
    SetupResult setup = new SetupResult(pluginSetupContext, classFileTransformerLoader);
    return setup;
}
Also used : SetupResult(com.navercorp.pinpoint.profiler.plugin.SetupResult) PluginInstrumentContext(com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext) InstrumentContext(com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext) PluginInstrumentContext(com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext) DefaultProfilerPluginSetupContext(com.navercorp.pinpoint.profiler.plugin.DefaultProfilerPluginSetupContext) GuardProfilerPluginContext(com.navercorp.pinpoint.profiler.plugin.GuardProfilerPluginContext) ClassFileTransformerLoader(com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader)

Aggregations

SetupResult (com.navercorp.pinpoint.profiler.plugin.SetupResult)3 ArrayList (java.util.ArrayList)2 InstrumentContext (com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext)1 ProfilerPlugin (com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin)1 ClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector)1 ClassFileTransformerLoader (com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader)1 DefaultProfilerPluginSetupContext (com.navercorp.pinpoint.profiler.plugin.DefaultProfilerPluginSetupContext)1 GuardProfilerPluginContext (com.navercorp.pinpoint.profiler.plugin.GuardProfilerPluginContext)1 PluginInstrumentContext (com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext)1 PluginSetup (com.navercorp.pinpoint.profiler.plugin.PluginSetup)1 ClassFileTransformer (java.lang.instrument.ClassFileTransformer)1