use of com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext in project pinpoint by naver.
the class JavassistEngine method getContextClassPool.
private ClassPool getContextClassPool(InstrumentContext instrumentContext, NamedClassPool parent, String jvmInternalClassName, byte[] classfileBuffer) throws NotFoundException {
final ClassPool contextCassPool = new ClassPool(parent);
contextCassPool.childFirstLookup = true;
final String javaName = JavaAssistUtils.jvmNameToJavaName(jvmInternalClassName);
if (isDebug) {
logger.debug("getContextClassPool() className={}", javaName);
}
final ClassPath byteArrayClassPath = new ByteArrayClassPath(javaName, classfileBuffer);
contextCassPool.insertClassPath(byteArrayClassPath);
// plugin class not found in jboss classLoader
if (instrumentContext instanceof PluginInstrumentContext) {
final PluginConfig pluginConfig = ((PluginInstrumentContext) instrumentContext).getPluginConfig();
if (pluginConfig != null) {
String jarPath = pluginConfig.getPluginJar().getPath();
contextCassPool.appendClassPath(jarPath);
}
}
return contextCassPool;
}
use of com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext 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;
}
use of com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext in project pinpoint by naver.
the class DebugTransformerRegistry method newDebugTransformer.
private DebugTransformer newDebugTransformer(ProfilerConfig profilerConfig, InstrumentEngine instrumentEngine, DynamicTransformTrigger dynamicTransformTrigger) {
ClassInjector classInjector = newClassInjector(profilerConfig);
ClassFileTransformerLoader transformerRegistry = new ClassFileTransformerLoader(profilerConfig, dynamicTransformTrigger);
InstrumentContext debugContext = new PluginInstrumentContext(profilerConfig, instrumentEngine, dynamicTransformTrigger, classInjector, transformerRegistry);
return new DebugTransformer(instrumentEngine, debugContext);
}
Aggregations