Search in sources :

Example 1 with GuardProfilerPluginSetupContext

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

the class MockPluginSetup method setupPlugin.

@Override
public PluginSetupResult setupPlugin(ProfilerPluginGlobalContext globalContext, ProfilerPlugin plugin, ClassInjector classInjector) {
    final ProfilerConfig profilerConfig = globalContext.getConfig();
    final DefaultProfilerPluginSetupContext pluginSetupContext = new DefaultProfilerPluginSetupContext(globalContext);
    final GuardProfilerPluginSetupContext guardPluginSetupContext = new GuardProfilerPluginSetupContext(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();
    }
    PluginSetupResult setup = new PluginSetupResult(pluginSetupContext, classFileTransformerLoader);
    return setup;
}
Also used : GuardProfilerPluginSetupContext(com.navercorp.pinpoint.profiler.plugin.GuardProfilerPluginSetupContext) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) PluginInstrumentContext(com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext) InstrumentContext(com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext) PluginInstrumentContext(com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext) PluginSetupResult(com.navercorp.pinpoint.profiler.plugin.PluginSetupResult) DefaultProfilerPluginSetupContext(com.navercorp.pinpoint.profiler.plugin.DefaultProfilerPluginSetupContext) ClassFileTransformerLoader(com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader)

Aggregations

ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)1 InstrumentContext (com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext)1 ClassFileTransformerLoader (com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader)1 DefaultProfilerPluginSetupContext (com.navercorp.pinpoint.profiler.plugin.DefaultProfilerPluginSetupContext)1 GuardProfilerPluginSetupContext (com.navercorp.pinpoint.profiler.plugin.GuardProfilerPluginSetupContext)1 PluginInstrumentContext (com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext)1 PluginSetupResult (com.navercorp.pinpoint.profiler.plugin.PluginSetupResult)1