[강운덕] [LUCYSUS-1744] jdk의 bootstrap 로더에 로딩되는 특수한 클래스의 경우 agent가 로드되는 AppClassaLoader보다 더 상위라서 기존 bci코드로는 하위 class Loader에 위치한 interceptor에 접근이 안되는 문제가 발생한다.

- ContextClassLoader를 이용하여 reflection으로 동적 호출되는 interceptor코드를 생성한다. 일반적인 was환경에서는 ContextClassLoader는 WebAppClassLoader가 되어 Agent의 cl보다 더 하위 cl이라 문제가 발생하지 않을것임.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1301 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-03-07 07:48:49 +00:00
parent 35f249f08a
commit dcd2b81f19
4 changed files with 109 additions and 38 deletions
@@ -1,5 +1,6 @@
package com.profiler.interceptor.bci;
import javassist.CannotCompileException;
import javassist.CtMethod;
import com.profiler.interceptor.Interceptor;
@@ -17,6 +18,8 @@ public interface InstrumentClass {
int addInterceptor(String methodName, String[] args, Interceptor interceptor) throws InstrumentException, NotFoundInstrumentException;
int addInterceptorFromContextClassLoader(String methodName, String[] args, Interceptor interceptor) throws InstrumentException, NotFoundInstrumentException;
int addInterceptor(String methodName, String[] args, Interceptor interceptor, Type type) throws InstrumentException, NotFoundInstrumentException;
boolean addDebugLogBeforeAfterMethod();
@@ -25,7 +28,7 @@ public interface InstrumentClass {
byte[] toBytecode() throws InstrumentException ;
Class<?> toClass() throws InstrumentException ;
Class<?> toClass() throws InstrumentException;
void addTraceVariable(String variableName, String setterName, String getterName, String variableType, String initValue) throws InstrumentException;