Search in sources :

Example 1 with ASMEngine

use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.

the class InstrumentEngineProvider method get.

public InstrumentEngine get() {
    final String instrumentEngine = instrumentConfig.getProfileInstrumentEngine().toUpperCase();
    if (InstrumentConfig.INSTRUMENT_ENGINE_ASM.equals(instrumentEngine)) {
        logger.info("ASM InstrumentEngine");
        // WARNING must be singleton
        final InterceptorDefinitionFactory interceptorDefinitionFactory = new InterceptorDefinitionFactory();
        // WARNING must be singleton
        final ScopeFactory scopeFactory = new ScopeFactory();
        EngineComponent engineComponent = new DefaultEngineComponent(objectBinderFactory, interceptorRegistryBinder, interceptorDefinitionFactory, apiMetaDataServiceProvider, scopeFactory);
        return new ASMEngine(instrumentation, engineComponent);
    } else {
        logger.warn("Unknown InstrumentEngine:{}", instrumentEngine);
        throw new IllegalArgumentException("Unknown InstrumentEngine:" + instrumentEngine);
    }
}
Also used : DefaultEngineComponent(com.navercorp.pinpoint.profiler.instrument.DefaultEngineComponent) ASMEngine(com.navercorp.pinpoint.profiler.instrument.ASMEngine) ScopeFactory(com.navercorp.pinpoint.profiler.instrument.ScopeFactory) InterceptorDefinitionFactory(com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinitionFactory) EngineComponent(com.navercorp.pinpoint.profiler.instrument.EngineComponent) DefaultEngineComponent(com.navercorp.pinpoint.profiler.instrument.DefaultEngineComponent)

Example 2 with ASMEngine

use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.

the class TestClassLoader method newTranslator.

private Translator newTranslator() {
    final InstrumentEngine instrumentEngine = applicationContext.getInstrumentEngine();
    if (instrumentEngine instanceof ASMEngine) {
        logger.info("ASM BCI engine");
        return new DefaultTranslator(this, applicationContext.getClassFileTransformer());
    }
    logger.info("Unknown BCI engine");
    return new DefaultTranslator(this, applicationContext.getClassFileTransformer());
}
Also used : ASMEngine(com.navercorp.pinpoint.profiler.instrument.ASMEngine) InstrumentEngine(com.navercorp.pinpoint.profiler.instrument.InstrumentEngine)

Example 3 with ASMEngine

use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.

the class TestClassLoader method addTranslator.

public void addTranslator() {
    final InstrumentEngine instrumentEngine = applicationContext.getInstrumentEngine();
    if (instrumentEngine instanceof JavassistEngine) {
        logger.info("JAVASSIST BCI engine");
        ClassPool classPool = ((JavassistEngine) instrumentEngine).getClassPool(this);
        this.instrumentTranslator = new JavassistTranslator(this, classPool, applicationContext.getClassFileTransformerDispatcher());
        this.addTranslator(instrumentTranslator);
    } else if (instrumentEngine instanceof ASMEngine) {
        logger.info("ASM BCI engine");
        this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
        this.addTranslator(instrumentTranslator);
    } else {
        logger.info("Unknown BCI engine");
        this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
        this.addTranslator(instrumentTranslator);
    }
}
Also used : ASMEngine(com.navercorp.pinpoint.profiler.instrument.ASMEngine) JavassistEngine(com.navercorp.pinpoint.profiler.instrument.JavassistEngine) ClassPool(javassist.ClassPool) InstrumentEngine(com.navercorp.pinpoint.profiler.instrument.InstrumentEngine)

Aggregations

ASMEngine (com.navercorp.pinpoint.profiler.instrument.ASMEngine)3 InstrumentEngine (com.navercorp.pinpoint.profiler.instrument.InstrumentEngine)2 DefaultEngineComponent (com.navercorp.pinpoint.profiler.instrument.DefaultEngineComponent)1 EngineComponent (com.navercorp.pinpoint.profiler.instrument.EngineComponent)1 JavassistEngine (com.navercorp.pinpoint.profiler.instrument.JavassistEngine)1 ScopeFactory (com.navercorp.pinpoint.profiler.instrument.ScopeFactory)1 InterceptorDefinitionFactory (com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinitionFactory)1 ClassPool (javassist.ClassPool)1