use of com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory in project pinpoint by naver.
the class ASMMethod method createInterceptor.
private Interceptor createInterceptor(String interceptorClassName, ScopeInfo scopeInfo, Object[] constructorArgs) {
final ClassLoader classLoader = this.declaringClass.getClassLoader();
// exception handling.
final AnnotatedInterceptorFactory factory = objectBinderFactory.newAnnotatedInterceptorFactory(this.pluginContext, true);
final Interceptor interceptor = factory.getInterceptor(classLoader, interceptorClassName, constructorArgs, scopeInfo.getScope(), scopeInfo.getPolicy(), this.declaringClass, this);
return interceptor;
}
use of com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory in project pinpoint by naver.
the class ObjectBinderFactory method newAnnotatedInterceptorFactory.
public AnnotatedInterceptorFactory newAnnotatedInterceptorFactory(InstrumentContext pluginContext, boolean exceptionHandle) {
final TraceContext traceContext = this.traceContextProvider.get();
ApiMetaDataService apiMetaDataService = this.apiMetaDataServiceProvider.get();
return new AnnotatedInterceptorFactory(profilerConfig, traceContext, dataSourceMonitorRegistry, apiMetaDataService, pluginContext, exceptionHandle);
}
use of com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory in project pinpoint by naver.
the class JavassistMethod method createInterceptor.
private Interceptor createInterceptor(String interceptorClassName, ScopeInfo scopeInfo, Object[] constructorArgs) {
ClassLoader classLoader = declaringClass.getClassLoader();
AnnotatedInterceptorFactory factory = objectBinderFactory.newAnnotatedInterceptorFactory(pluginContext, false);
Interceptor interceptor = factory.getInterceptor(classLoader, interceptorClassName, constructorArgs, scopeInfo.getScope(), scopeInfo.getPolicy(), declaringClass, this);
return interceptor;
}
use of com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory in project pinpoint by naver.
the class AnnotatedInterceptorFactoryTest method test2.
@Test(expected = PinpointException.class)
public void test2() throws Exception {
Object[] args = new Object[] { 1 };
AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
factory.getInterceptor(getClass().getClassLoader(), TestInterceptor0.class.getName(), args, null, null, instrumentClass, instrumentMethod);
}
use of com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory in project pinpoint by naver.
the class AnnotatedInterceptorFactoryTest method test4.
@Test
public void test4() throws Exception {
Object[] args = new Object[] { (byte) 1, (short) 2, (float) 3.0, "arg0" };
AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), args, null, null, instrumentClass, instrumentMethod);
assertEquals(TestInterceptor1.class, interceptor.getClass());
assertEquals(args[3], getField(interceptor, "field0"));
assertEquals(args[0], getField(interceptor, "field1"));
assertEquals(args[1], getField(interceptor, "field2"));
assertEquals(args[2], getField(interceptor, "field3"));
}
Aggregations