|
16 | 16 | *
|
17 | 17 | */
|
18 | 18 |
|
19 |
| -package org.apache.skywalking.apm.plugin.jdbc.oracle.define; |
| 19 | +package io.skywalking.apm.plugin.jdbc.oracle.define; |
20 | 20 |
|
21 | 21 | import net.bytebuddy.description.method.MethodDescription;
|
22 | 22 | import net.bytebuddy.matcher.ElementMatcher;
|
|
26 | 26 | import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
27 | 27 | import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;
|
28 | 28 |
|
| 29 | +import static io.skywalking.apm.plugin.jdbc.oracle.Constants.STATEMENT_INTERCEPT_CLASS; |
29 | 30 | import static net.bytebuddy.matcher.ElementMatchers.named;
|
30 |
| -import static org.apache.skywalking.apm.plugin.jdbc.oracle.Constants.STATEMENT_INTERCEPT_CLASS; |
31 | 31 |
|
32 | 32 | public class OracleStatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
33 | 33 |
|
34 | 34 | public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OracleStatement";
|
35 | 35 | public static final String STATEMENT_WRAPPER_CLASS = "oracle.jdbc.driver.OracleStatementWrapper";
|
36 | 36 | public static final String T4C_STATEMENT_CLASS = "oracle.jdbc.driver.T4CStatement";
|
37 | 37 |
|
38 |
| - @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { |
| 38 | + @Override |
| 39 | + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { |
39 | 40 | return new ConstructorInterceptPoint[0];
|
40 | 41 | }
|
41 | 42 |
|
42 |
| - @Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { |
43 |
| - return new InstanceMethodsInterceptPoint[] { |
44 |
| - new InstanceMethodsInterceptPoint() { |
45 |
| - @Override public ElementMatcher<MethodDescription> getMethodsMatcher() { |
46 |
| - return named("execute") |
47 |
| - .or(named("executeQuery")) |
48 |
| - .or(named("executeUpdate")) |
49 |
| - .or(named("executeLargeUpdate")) |
50 |
| - .or(named("executeBatchInternal")) |
51 |
| - .or(named("executeUpdateInternal")) |
52 |
| - .or(named("executeQuery")); |
53 |
| - } |
| 43 | + @Override |
| 44 | + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { |
| 45 | + return new InstanceMethodsInterceptPoint[]{ |
| 46 | + new InstanceMethodsInterceptPoint() { |
| 47 | + @Override |
| 48 | + public ElementMatcher<MethodDescription> getMethodsMatcher() { |
| 49 | + return named("execute") |
| 50 | + .or(named("executeQuery")) |
| 51 | + .or(named("executeUpdate")) |
| 52 | + .or(named("executeLargeUpdate")) |
| 53 | + .or(named("executeBatchInternal")) |
| 54 | + .or(named("executeUpdateInternal")) |
| 55 | + .or(named("executeQuery")); |
| 56 | + } |
54 | 57 |
|
55 |
| - @Override public String getMethodsInterceptor() { |
56 |
| - return STATEMENT_INTERCEPT_CLASS; |
57 |
| - } |
| 58 | + @Override |
| 59 | + public String getMethodsInterceptor() { |
| 60 | + return STATEMENT_INTERCEPT_CLASS; |
| 61 | + } |
58 | 62 |
|
59 |
| - @Override public boolean isOverrideArgs() { |
60 |
| - return false; |
| 63 | + @Override |
| 64 | + public boolean isOverrideArgs() { |
| 65 | + return false; |
| 66 | + } |
61 | 67 | }
|
62 |
| - } |
63 | 68 | };
|
64 | 69 | }
|
65 | 70 |
|
66 |
| - @Override protected ClassMatch enhanceClass() { |
| 71 | + @Override |
| 72 | + protected ClassMatch enhanceClass() { |
67 | 73 | return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS, STATEMENT_WRAPPER_CLASS, T4C_STATEMENT_CLASS);
|
68 | 74 | }
|
69 | 75 | }
|
0 commit comments