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;
}
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;
}
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;
}
Aggregations