use of com.navercorp.pinpoint.profiler.instrument.GuardInstrumentContext in project pinpoint by naver.
the class DefaultPluginSetup method preparePlugin.
private GuardInstrumentContext preparePlugin(ProfilerPlugin plugin, InstrumentContext instrumentContext) {
final GuardInstrumentContext guardInstrumentContext = new GuardInstrumentContext(instrumentContext);
if (plugin instanceof TransformTemplateAware) {
if (logger.isDebugEnabled()) {
logger.debug("{}.setTransformTemplate", plugin.getClass().getName());
}
final TransformTemplate transformTemplate = new TransformTemplate(guardInstrumentContext);
((TransformTemplateAware) plugin).setTransformTemplate(transformTemplate);
}
return guardInstrumentContext;
}
use of com.navercorp.pinpoint.profiler.instrument.GuardInstrumentContext in project pinpoint by naver.
the class DefaultPluginSetup method setupPlugin.
@Override
public SetupResult setupPlugin(ProfilerPlugin profilerPlugin, ClassInjector classInjector) {
final ClassFileTransformerLoader transformerRegistry = new ClassFileTransformerLoader(profilerConfig, dynamicTransformTrigger);
final DefaultProfilerPluginSetupContext setupContext = new DefaultProfilerPluginSetupContext(profilerConfig);
final GuardProfilerPluginContext guardSetupContext = new GuardProfilerPluginContext(setupContext);
final InstrumentContext instrumentContext = new PluginInstrumentContext(profilerConfig, instrumentEngine, dynamicTransformTrigger, classInjector, transformerRegistry);
final GuardInstrumentContext guardInstrumentContext = preparePlugin(profilerPlugin, instrumentContext);
try {
// WARN external plugin api
if (logger.isInfoEnabled()) {
logger.info("{} Plugin setup", profilerPlugin.getClass().getName());
}
profilerPlugin.setup(guardSetupContext);
} finally {
guardSetupContext.close();
guardInstrumentContext.close();
}
SetupResult setupResult = new SetupResult(setupContext, transformerRegistry);
return setupResult;
}
Aggregations