mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-20 18:25:55 +10:00
[강운덕] [LUCYSUS-1744] 바이트 코드 변환 부분 추상화.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@531 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.profiler.interceptor.bci;
|
||||
|
||||
import com.profiler.interceptor.Interceptor;
|
||||
import javassist.CannotCompileException;
|
||||
import javassist.CtClass;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class JavaAssistClass implements InstrumentClass {
|
||||
|
||||
private final Logger logger = Logger.getLogger(this.getClass().getName());
|
||||
|
||||
private JavaAssistByteCodeInstrumentor instrumentor;
|
||||
private CtClass ctClass;
|
||||
|
||||
public JavaAssistClass(JavaAssistByteCodeInstrumentor instrumentor, CtClass ctClass) {
|
||||
this.instrumentor = instrumentor;
|
||||
this.ctClass = ctClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptor(String methodName, String[] args, Interceptor interceptor) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] toBytecode() {
|
||||
try {
|
||||
return ctClass.toBytecode();
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.INFO, "IoException class:" + ctClass.getName() + " " + e.getMessage(), e);
|
||||
} catch (CannotCompileException e) {
|
||||
logger.log(Level.INFO, "CannotCompileException class:" + ctClass.getName() + " " + e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user