Search in sources :

Example 1 with InterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder in project pinpoint by naver.

the class DefaultApplicationContextTest method newApplicationContext.

private DefaultApplicationContext newApplicationContext() {
    ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
    when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
    // when(profilerConfig.getTransportModule()).thenReturn("GRPC");
    Instrumentation instrumentation = mock(Instrumentation.class);
    AgentOption agentOption = new DefaultAgentOption(instrumentation, "mockAgentId", "mockAgentName", "mockApplicationName", false, profilerConfig, Collections.<String>emptyList(), Collections.<String>emptyList());
    InterceptorRegistryBinder interceptorRegistryBinder = new TestInterceptorRegistryBinder();
    Module interceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(interceptorRegistryModule);
    return new DefaultApplicationContext(agentOption, moduleFactory);
}
Also used : DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) Instrumentation(java.lang.instrument.Instrumentation) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) Module(com.google.inject.Module)

Example 2 with InterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder in project pinpoint by naver.

the class MockTraceContextFactory method newMockApplicationContext.

public static DefaultApplicationContext newMockApplicationContext(ProfilerConfig profilerConfig) {
    Module loggingModule = new LoggingModule();
    InterceptorRegistryBinder interceptorRegistryBinder = new EmptyInterceptorRegistryBinder();
    Module interceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(loggingModule, interceptorRegistryModule);
    MockApplicationContextFactory factory = new MockApplicationContextFactory();
    return factory.build(profilerConfig, moduleFactory);
}
Also used : ModuleFactory(com.navercorp.pinpoint.profiler.context.module.ModuleFactory) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) Module(com.google.inject.Module) AbstractModule(com.google.inject.AbstractModule)

Example 3 with InterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder in project pinpoint by naver.

the class MockApplicationContextFactory method newModuleFactory.

private ModuleFactory newModuleFactory() {
    Module pluginModule = new MockApplicationContextModule();
    InterceptorRegistryBinder binder = new TestInterceptorRegistryBinder();
    Module interceptorRegistryModule = InterceptorRegistryModule.wrap(binder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(pluginModule, interceptorRegistryModule);
    return moduleFactory;
}
Also used : ModuleFactory(com.navercorp.pinpoint.profiler.context.module.ModuleFactory) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) Module(com.google.inject.Module)

Example 4 with InterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder in project pinpoint by naver.

the class MockApplicationContext method of.

public static MockApplicationContext of(ProfilerConfig config) {
    AgentOption agentOption = new DefaultAgentOption(new DummyInstrumentation(), "mockAgent", "mockApplicationName", config, new URL[0], null, new DefaultServiceTypeRegistryService(), new DefaultAnnotationKeyRegistryService());
    InterceptorRegistryBinder binder = new TestInterceptorRegistryBinder();
    binder.bind();
    return new MockApplicationContext(agentOption, binder);
}
Also used : DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) DefaultServiceTypeRegistryService(com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) DefaultAnnotationKeyRegistryService(com.navercorp.pinpoint.common.service.DefaultAnnotationKeyRegistryService)

Example 5 with InterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder in project pinpoint by naver.

the class PluginTestAgent method newApplicationContext.

@Override
protected ApplicationContext newApplicationContext(AgentOption agentOption, InterceptorRegistryBinder interceptorRegistryBinder) {
    this.pluginApplicationContextModule = new PluginApplicationContextModule();
    ApplicationContext applicationContext = new DefaultApplicationContext(agentOption, interceptorRegistryBinder) {

        @Override
        protected Module newApplicationContextModule(AgentOption agentOption, InterceptorRegistryBinder interceptorRegistryBinder) {
            Module applicationContextModule = super.newApplicationContextModule(agentOption, interceptorRegistryBinder);
            return Modules.override(applicationContextModule).with(pluginApplicationContextModule);
        }
    };
    return applicationContext;
}
Also used : DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) ApplicationContext(com.navercorp.pinpoint.profiler.context.module.ApplicationContext) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) DefaultInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.DefaultInterceptorRegistryBinder) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) Module(com.google.inject.Module)

Aggregations

InterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder)11 Module (com.google.inject.Module)7 AgentOption (com.navercorp.pinpoint.bootstrap.AgentOption)5 ModuleFactory (com.navercorp.pinpoint.profiler.context.module.ModuleFactory)5 DefaultAgentOption (com.navercorp.pinpoint.bootstrap.DefaultAgentOption)4 Instrumentation (java.lang.instrument.Instrumentation)4 DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)3 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)3 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)3 DefaultInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.DefaultInterceptorRegistryBinder)3 TestInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder)3 Test (org.junit.Test)3 AbstractModule (com.google.inject.AbstractModule)2 InterceptorRegistryModule (com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule)2 OverrideModuleFactory (com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory)2 InterceptorDefinition (com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinition)2 InterceptorDefinitionFactory (com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorDefinitionFactory)2 ArgsArrayInterceptor (com.navercorp.pinpoint.profiler.instrument.mock.ArgsArrayInterceptor)2 Injector (com.google.inject.Injector)1 GraphvizModule (com.google.inject.grapher.graphviz.GraphvizModule)1