refactory code

This commit is contained in:
ascrutae 2017-12-06 14:56:09 +08:00
parent 3f2e7904c3
commit aa55121b8f
2 changed files with 5 additions and 3 deletions

View File

@ -49,8 +49,6 @@ import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INT
*/
public abstract class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
public static final String ENHANCE_CLASS = "com.mysql.jdbc.ConnectionImpl";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}

View File

@ -29,7 +29,11 @@ import static org.skywalking.apm.plugin.jdbc.mysql.define.MultiClassNameMatch.by
* @author zhangxin
*/
public class Mysql5xConnectionInstrumentation extends ConnectionInstrumentation {
public static final String ENHANCE_CLASS = "com.mysql.jdbc.ConnectionImpl";
public static final String CJ_JDBC_ENHANCE_CLASS = "com.mysql.cj.jdbc.ConnectionImpl";
@Override protected ClassMatch enhanceClass() {
return byMultiClassMatch(ENHANCE_CLASS, "com.mysql.cj.jdbc.ConnectionImpl");
return byMultiClassMatch(ENHANCE_CLASS, CJ_JDBC_ENHANCE_CLASS);
}
}