Search in sources :

Example 1 with OverrideModuleFactory

use of com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory in project pinpoint by naver.

the class DependencyGraph method newApplicationContext.

private DefaultApplicationContext newApplicationContext() {
    ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
    Mockito.when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
    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 testInterceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(testInterceptorRegistryModule);
    return new DefaultApplicationContext(agentOption, moduleFactory);
}
Also used : OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) ModuleFactory(com.navercorp.pinpoint.profiler.context.module.ModuleFactory) DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) 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) OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) Instrumentation(java.lang.instrument.Instrumentation) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) Module(com.google.inject.Module) InterceptorRegistryModule(com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule) GraphvizModule(com.google.inject.grapher.graphviz.GraphvizModule)

Example 2 with OverrideModuleFactory

use of com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory 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 : OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) ModuleFactory(com.navercorp.pinpoint.profiler.context.module.ModuleFactory) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) Module(com.google.inject.Module) InterceptorRegistryModule(com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule) AbstractModule(com.google.inject.AbstractModule)

Aggregations

Module (com.google.inject.Module)2 InterceptorRegistryModule (com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule)2 ModuleFactory (com.navercorp.pinpoint.profiler.context.module.ModuleFactory)2 OverrideModuleFactory (com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory)2 InterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder)2 AbstractModule (com.google.inject.AbstractModule)1 GraphvizModule (com.google.inject.grapher.graphviz.GraphvizModule)1 AgentOption (com.navercorp.pinpoint.bootstrap.AgentOption)1 DefaultAgentOption (com.navercorp.pinpoint.bootstrap.DefaultAgentOption)1 DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)1 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)1 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)1 TestInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder)1 Instrumentation (java.lang.instrument.Instrumentation)1