Files
pinpoint/src/main/java/com/profiler/interceptor/bci/InstrumentClass.java
T
Woonduk Kang dcd2b81f19 [강운덕] [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
2013-03-07 07:48:49 +00:00

45 lines
1.8 KiB
Java

package com.profiler.interceptor.bci;
import javassist.CannotCompileException;
import javassist.CtMethod;
import com.profiler.interceptor.Interceptor;
public interface InstrumentClass {
boolean insertCodeBeforeMethod(String methodName, String[] args, String code);
boolean insertCodeAfterMethod(String methodName, String[] args, String code);
int addConstructorInterceptor(String[] args, Interceptor interceptor) throws InstrumentException, NotFoundInstrumentException;
int reuseInterceptor(String methodName, String[] args, int interceptorId) throws InstrumentException, NotFoundInstrumentException;
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();
boolean addDebugLogBeforeAfterConstructor();
byte[] toBytecode() throws InstrumentException ;
Class<?> toClass() throws InstrumentException;
void addTraceVariable(String variableName, String setterName, String getterName, String variableType, String initValue) throws InstrumentException;
void addTraceVariable(String variableName, String setterName, String getterName, String variableType) throws InstrumentException;
boolean insertCodeAfterConstructor(String[] args, String code);
boolean insertCodeBeforeConstructor(String[] args, String code);
public CtMethod[] getDeclaredMethods();
public boolean isInterceptable();
}