use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScope in project pinpoint by naver.
the class JavassistClass method addScopedInterceptor.
@Override
public int addScopedInterceptor(String interceptorClassName, Object[] constructorArgs, String scopeName, ExecutionPolicy executionPolicy) throws InstrumentException {
Asserts.notNull(interceptorClassName, "interceptorClassName");
Asserts.notNull(constructorArgs, "constructorArgs");
Asserts.notNull(scopeName, "scopeName");
Asserts.notNull(executionPolicy, "executionPolicy");
final InterceptorScope interceptorScope = pluginContext.getInterceptorScope(scopeName);
return addInterceptor0(interceptorClassName, constructorArgs, interceptorScope, executionPolicy);
}
use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScope in project pinpoint by naver.
the class AnnotatedInterceptorFactory method getInterceptor.
@Override
public Interceptor getInterceptor(ClassLoader classLoader, String interceptorClassName, Object[] providedArguments, InterceptorScope scope, ExecutionPolicy policy, InstrumentClass target, InstrumentMethod targetMethod) {
Class<? extends Interceptor> interceptorType = pluginContext.injectClass(classLoader, interceptorClassName);
if (scope == null) {
Scope interceptorScope = interceptorType.getAnnotation(Scope.class);
if (interceptorScope != null) {
String scopeName = interceptorScope.value();
scope = pluginContext.getInterceptorScope(scopeName);
policy = interceptorScope.executionPolicy();
}
}
AutoBindingObjectFactory factory = new AutoBindingObjectFactory(profilerConfig, traceContext, pluginContext, classLoader);
ObjectFactory objectFactory = ObjectFactory.byConstructor(interceptorClassName, providedArguments);
InterceptorArgumentProvider interceptorArgumentProvider = new InterceptorArgumentProvider(dataSourceMonitorRegistry, apiMetaDataService, scope, target, targetMethod);
Interceptor interceptor = (Interceptor) factory.createInstance(objectFactory, interceptorArgumentProvider);
if (scope != null) {
if (exceptionHandle) {
interceptor = wrapByExceptionHandleScope(interceptor, scope, policy == null ? ExecutionPolicy.BOUNDARY : policy);
} else {
interceptor = wrapByScope(interceptor, scope, policy == null ? ExecutionPolicy.BOUNDARY : policy);
}
} else {
if (exceptionHandle) {
interceptor = wrapByExceptionHandle(interceptor);
}
}
return interceptor;
}
use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScope in project pinpoint by naver.
the class JavassistMethod method addScopedInterceptor.
@Override
public int addScopedInterceptor(String interceptorClassName, Object[] constructorArgs, String scopeName) throws InstrumentException {
Asserts.notNull(interceptorClassName, "interceptorClassName");
Asserts.notNull(constructorArgs, "constructorArgs");
Asserts.notNull(scopeName, "scopeName");
final InterceptorScope interceptorScope = this.pluginContext.getInterceptorScope(scopeName);
return addInterceptor0(interceptorClassName, constructorArgs, interceptorScope, null);
}
use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScope in project pinpoint by naver.
the class JavassistMethod method addScopedInterceptor.
@Override
public int addScopedInterceptor(String interceptorClassName, String scopeName, ExecutionPolicy executionPolicy) throws InstrumentException {
Asserts.notNull(interceptorClassName, "interceptorClassName");
Asserts.notNull(scopeName, "scopeName");
Asserts.notNull(executionPolicy, "executionPolicy");
final InterceptorScope interceptorScope = this.pluginContext.getInterceptorScope(scopeName);
return addInterceptor0(interceptorClassName, null, interceptorScope, executionPolicy);
}
use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScope in project pinpoint by naver.
the class ASMMethod method addScopedInterceptor.
@Override
public int addScopedInterceptor(String interceptorClassName, Object[] constructorArgs, String scopeName) throws InstrumentException {
Asserts.notNull(interceptorClassName, "interceptorClassName");
Asserts.notNull(constructorArgs, "constructorArgs");
Asserts.notNull(scopeName, "scopeName");
final InterceptorScope interceptorScope = this.pluginContext.getInterceptorScope(scopeName);
return addInterceptor0(interceptorClassName, constructorArgs, interceptorScope, null);
}
Aggregations