Search in sources :

Example 1 with EngineComponent

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

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

the class MethodInterfaceTest method isInterceptable.

@Test
public void isInterceptable() throws Exception {
    ClassNode classNode = TestClassLoader.get("com.navercorp.test.pinpoint.jdk8.interfaces.MethodInterface");
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    EngineComponent engineComponent = mock(EngineComponent.class);
    ASMClass clazz = new ASMClass(engineComponent, pluginContext, classLoader, null, classNode);
    assertTrue(clazz.isInterceptable());
}
Also used : ClassNode(org.objectweb.asm.tree.ClassNode) ASMClass(com.navercorp.pinpoint.profiler.instrument.ASMClass) EngineComponent(com.navercorp.pinpoint.profiler.instrument.EngineComponent) Test(org.junit.Test)

Aggregations

EngineComponent (com.navercorp.pinpoint.profiler.instrument.EngineComponent)2 ASMClass (com.navercorp.pinpoint.profiler.instrument.ASMClass)1 ASMEngine (com.navercorp.pinpoint.profiler.instrument.ASMEngine)1 DefaultEngineComponent (com.navercorp.pinpoint.profiler.instrument.DefaultEngineComponent)1 ScopeFactory (com.navercorp.pinpoint.profiler.instrument.ScopeFactory)1 InterceptorDefinitionFactory (com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinitionFactory)1 Test (org.junit.Test)1 ClassNode (org.objectweb.asm.tree.ClassNode)1