From b39d080cd58178040610e0895f4eefa1a528582c Mon Sep 17 00:00:00 2001 From: Woonduk Kang Date: Tue, 3 Jun 2014 10:05:50 +0000 Subject: [PATCH] =?UTF-8?q?[=EA=B0=95=EC=9A=B4=EB=8D=95]=20[PROFILER-34]?= =?UTF-8?q?=20loadbalance=20driver=EA=B4=80=EB=A0=A8=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@3984 84d0f5b1-2673-498c-a247-62c4ff18d310 --- ...QLLoadBalancedMySQLConnectionModifier.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/main/java/com/nhn/pinpoint/profiler/modifier/db/mysql/MySQLLoadBalancedMySQLConnectionModifier.java diff --git a/src/main/java/com/nhn/pinpoint/profiler/modifier/db/mysql/MySQLLoadBalancedMySQLConnectionModifier.java b/src/main/java/com/nhn/pinpoint/profiler/modifier/db/mysql/MySQLLoadBalancedMySQLConnectionModifier.java deleted file mode 100644 index d283050b4..000000000 --- a/src/main/java/com/nhn/pinpoint/profiler/modifier/db/mysql/MySQLLoadBalancedMySQLConnectionModifier.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.nhn.pinpoint.profiler.modifier.db.mysql; - -import com.mysql.jdbc.LoadBalancedMySQLConnection; -import com.nhn.pinpoint.bootstrap.Agent; -import com.nhn.pinpoint.bootstrap.interceptor.Interceptor; -import com.nhn.pinpoint.profiler.interceptor.bci.ByteCodeInstrumentor; -import com.nhn.pinpoint.profiler.interceptor.bci.InstrumentClass; -import com.nhn.pinpoint.profiler.interceptor.bci.InstrumentException; -import com.nhn.pinpoint.profiler.modifier.AbstractModifier; -import com.nhn.pinpoint.profiler.modifier.db.interceptor.DriverConnectInterceptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.security.ProtectionDomain; - -/** - * @author emeroad - */ -public class MySQLLoadBalancedMySQLConnectionModifier extends AbstractModifier { - - private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - public MySQLLoadBalancedMySQLConnectionModifier(ByteCodeInstrumentor byteCodeInstrumentor, Agent agent) { - super(byteCodeInstrumentor, agent); - } - - public String getTargetClass() { - return "com/mysql/jdbc/LoadBalancedMySQLConnection"; - } - - public byte[] modify(ClassLoader classLoader, String javassistClassName, ProtectionDomain protectedDomain, byte[] classFileBuffer) { - if (logger.isInfoEnabled()) { - logger.info("Modifing. {}", javassistClassName); - } - // 여기는 추상클래스로 빼서 - this.byteCodeInstrumentor.checkLibrary(classLoader, javassistClassName); - try { - InstrumentClass mysqlConnection = byteCodeInstrumentor.getClass(javassistClassName); - - - - Interceptor createConnection = new DriverConnectInterceptor(); - String[] params = new String[]{ - "java.lang.String", "java.util.Properties" - }; - mysqlConnection.addInterceptor("connect", params, createConnection); - - if (this.logger.isInfoEnabled()) { - this.logger.info("{} class is converted.", javassistClassName); - } - - return mysqlConnection.toBytecode(); - } catch (InstrumentException e) { - if (logger.isWarnEnabled()) { - logger.warn("{} modify fail. Cause:{}", this.getClass().getSimpleName(), e.getMessage(), e); - } - return null; - } - } -}