googleJavaFormat
This commit is contained in:
parent
6b5acc8386
commit
8a89547004
|
@ -1,15 +1,20 @@
|
||||||
package datadog.trace.instrumentation.springdata;
|
package datadog.trace.instrumentation.springdata;
|
||||||
|
|
||||||
|
import static datadog.trace.instrumentation.springdata.SpringDataDecorator.DECORATOR;
|
||||||
|
import static net.bytebuddy.matcher.ElementMatchers.*;
|
||||||
|
|
||||||
import com.google.auto.service.AutoService;
|
import com.google.auto.service.AutoService;
|
||||||
import datadog.trace.agent.tooling.Instrumenter;
|
import datadog.trace.agent.tooling.Instrumenter;
|
||||||
import io.opentracing.Scope;
|
import io.opentracing.Scope;
|
||||||
import io.opentracing.Span;
|
import io.opentracing.Span;
|
||||||
import io.opentracing.util.GlobalTracer;
|
import io.opentracing.util.GlobalTracer;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
import net.bytebuddy.asm.Advice;
|
import net.bytebuddy.asm.Advice;
|
||||||
import net.bytebuddy.description.method.MethodDescription;
|
import net.bytebuddy.description.method.MethodDescription;
|
||||||
import net.bytebuddy.description.type.TypeDescription;
|
import net.bytebuddy.description.type.TypeDescription;
|
||||||
import net.bytebuddy.matcher.ElementMatcher;
|
import net.bytebuddy.matcher.ElementMatcher;
|
||||||
import net.bytebuddy.utility.JavaModule;
|
|
||||||
import org.aopalliance.intercept.MethodInterceptor;
|
import org.aopalliance.intercept.MethodInterceptor;
|
||||||
import org.aopalliance.intercept.MethodInvocation;
|
import org.aopalliance.intercept.MethodInvocation;
|
||||||
import org.springframework.aop.framework.ProxyFactory;
|
import org.springframework.aop.framework.ProxyFactory;
|
||||||
|
@ -17,14 +22,6 @@ import org.springframework.data.repository.Repository;
|
||||||
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
||||||
import org.springframework.data.repository.core.support.RepositoryProxyPostProcessor;
|
import org.springframework.data.repository.core.support.RepositoryProxyPostProcessor;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.security.ProtectionDomain;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static datadog.trace.instrumentation.springdata.SpringDataDecorator.DECORATOR;
|
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.*;
|
|
||||||
|
|
||||||
@AutoService(Instrumenter.class)
|
@AutoService(Instrumenter.class)
|
||||||
public final class SpringRepositoryInstrumentation extends Instrumenter.Default {
|
public final class SpringRepositoryInstrumentation extends Instrumenter.Default {
|
||||||
|
|
||||||
|
@ -50,8 +47,7 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
|
||||||
@Override
|
@Override
|
||||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||||
return Collections.singletonMap(
|
return Collections.singletonMap(
|
||||||
isConstructor(),
|
isConstructor(), RepositoryFactorySupportAdvice.class.getName());
|
||||||
RepositoryFactorySupportAdvice.class.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class RepositoryFactorySupportAdvice {
|
public static class RepositoryFactorySupportAdvice {
|
||||||
|
@ -63,7 +59,8 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class InterceptingRepositoryProxyPostProcessor implements RepositoryProxyPostProcessor {
|
public static final class InterceptingRepositoryProxyPostProcessor
|
||||||
|
implements RepositoryProxyPostProcessor {
|
||||||
public static final RepositoryProxyPostProcessor INSTANCE =
|
public static final RepositoryProxyPostProcessor INSTANCE =
|
||||||
new InterceptingRepositoryProxyPostProcessor();
|
new InterceptingRepositoryProxyPostProcessor();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue