use of com.navercorp.pinpoint.profiler.context.module.ModuleFactory in project pinpoint by naver.
the class DefaultAgent method newApplicationContext.
protected ApplicationContext newApplicationContext(AgentOption agentOption) {
Objects.requireNonNull(agentOption, "agentOption");
ProfilerConfig profilerConfig = Objects.requireNonNull(agentOption.getProfilerConfig(), "profilerConfig");
ModuleFactoryResolver moduleFactoryResolver = new DefaultModuleFactoryResolver(profilerConfig.getInjectionModuleFactoryClazzName());
ModuleFactory moduleFactory = moduleFactoryResolver.resolve();
return new DefaultApplicationContext(agentOption, moduleFactory);
}
use of com.navercorp.pinpoint.profiler.context.module.ModuleFactory 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);
}
use of com.navercorp.pinpoint.profiler.context.module.ModuleFactory 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);
}
Aggregations