Search in sources :

Example 1 with JavassistEngine

use of com.navercorp.pinpoint.profiler.instrument.JavassistEngine 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)

Example 2 with JavassistEngine

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

the class JavassistClassTest method newJavassistEngine.

private InstrumentEngine newJavassistEngine() {
    Instrumentation instrumentation = mock(Instrumentation.class);
    ObjectBinderFactory objectBinderFactory = mock(ObjectBinderFactory.class);
    Provider<ApiMetaDataService> apiMetaDataService = Providers.of(mock(ApiMetaDataService.class));
    return new JavassistEngine(instrumentation, objectBinderFactory, new GlobalInterceptorRegistryBinder(), apiMetaDataService, null);
}
Also used : JavassistEngine(com.navercorp.pinpoint.profiler.instrument.JavassistEngine) Instrumentation(java.lang.instrument.Instrumentation) ObjectBinderFactory(com.navercorp.pinpoint.profiler.objectfactory.ObjectBinderFactory) ApiMetaDataService(com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService) GlobalInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.GlobalInterceptorRegistryBinder)

Aggregations

JavassistEngine (com.navercorp.pinpoint.profiler.instrument.JavassistEngine)2 ASMEngine (com.navercorp.pinpoint.profiler.instrument.ASMEngine)1 InstrumentEngine (com.navercorp.pinpoint.profiler.instrument.InstrumentEngine)1 GlobalInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.GlobalInterceptorRegistryBinder)1 ApiMetaDataService (com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService)1 ObjectBinderFactory (com.navercorp.pinpoint.profiler.objectfactory.ObjectBinderFactory)1 Instrumentation (java.lang.instrument.Instrumentation)1 ClassPool (javassist.ClassPool)1