Search in sources :

Example 1 with MethodRecipe

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);
}
Also used : AutoBindingObjectFactory(com.navercorp.pinpoint.profiler.objectfactory.AutoBindingObjectFactory) MethodFilter(com.navercorp.pinpoint.bootstrap.instrument.MethodFilter) MethodRecipe(com.navercorp.pinpoint.profiler.plugin.xml.transformer.MethodRecipe) PinpointException(com.navercorp.pinpoint.exception.PinpointException) InterceptorArgumentProvider(com.navercorp.pinpoint.profiler.objectfactory.InterceptorArgumentProvider) FilteringMethodTransformer(com.navercorp.pinpoint.profiler.plugin.xml.transformer.FilteringMethodTransformer)

Aggregations

MethodFilter (com.navercorp.pinpoint.bootstrap.instrument.MethodFilter)1 PinpointException (com.navercorp.pinpoint.exception.PinpointException)1 AutoBindingObjectFactory (com.navercorp.pinpoint.profiler.objectfactory.AutoBindingObjectFactory)1 InterceptorArgumentProvider (com.navercorp.pinpoint.profiler.objectfactory.InterceptorArgumentProvider)1 FilteringMethodTransformer (com.navercorp.pinpoint.profiler.plugin.xml.transformer.FilteringMethodTransformer)1 MethodRecipe (com.navercorp.pinpoint.profiler.plugin.xml.transformer.MethodRecipe)1