use of com.navercorp.pinpoint.profiler.plugin.xml.transformer.MethodRecipe in project pinpoint by naver.
the class TargetAnnotatedInterceptorInjector method createFilteredMethodEditor.
private MethodTransformer createFilteredMethodEditor(TargetFilter annotation, InstrumentClass targetClass, AnnotatedInterceptorInjector injector, ClassLoader classLoader) {
String type = annotation.type();
if (type == null) {
throw new PinpointException("type of @TargetFilter is null: " + interceptorClassName);
}
final InterceptorArgumentProvider interceptorArgumentProvider = new InterceptorArgumentProvider(dataSourceMonitorRegistry, apiMetaDataService, targetClass);
AutoBindingObjectFactory filterFactory = new AutoBindingObjectFactory(profilerConfig, traceContext, pluginContext, classLoader, interceptorArgumentProvider);
MethodFilter filter = (MethodFilter) filterFactory.createInstance(ObjectFactory.byConstructor(type, (Object[]) annotation.constructorArguments()));
MethodRecipe recipe = annotation.singleton() ? new SharedAnnotatedInterceptorInjector(injector) : injector;
return new FilteringMethodTransformer(new MethodFilter[] { filter }, Arrays.<MethodRecipe>asList(recipe), null);
}
Aggregations