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);
}
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);
}
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;
}
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);
}
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;
}
Aggregations