mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-21 10:45:59 +10:00
[강운덕] [LUCYSUS-1744] modifier관련 static api를 instance api로 변경 1차 작업수행..
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@465 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -7,62 +7,11 @@ import javassist.CtClass;
|
||||
import javassist.CtConstructor;
|
||||
import javassist.CtMethod;
|
||||
|
||||
public abstract class AbstractModifier {
|
||||
public abstract class AbstractModifier implements Modifier {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AbstractModifier.class);
|
||||
|
||||
public static void printClassInfo(String className) {
|
||||
logger.debug("Printing Class Info of [" + className + "]");
|
||||
try {
|
||||
ClassPool pool = ClassPool.getDefault();
|
||||
logger.debug("try");
|
||||
String javaassistClassName = className.replace('/', '.');
|
||||
logger.debug("replace");
|
||||
CtClass cc = pool.get(javaassistClassName);
|
||||
logger.debug("ClassName:" + javaassistClassName);
|
||||
CtConstructor[] constructorList = cc.getConstructors();
|
||||
|
||||
for (CtConstructor cons : constructorList) {
|
||||
try {
|
||||
String signature = cons.getSignature();
|
||||
logger.info("Constructor signature:%s", signature);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
CtMethod[] methodList = cc.getDeclaredMethods();
|
||||
|
||||
for (CtMethod tempMethod : methodList) {
|
||||
try {
|
||||
String methodName = tempMethod.getLongName();
|
||||
|
||||
logger.debug("MethodName:" + methodName);
|
||||
|
||||
CtClass[] params = tempMethod.getParameterTypes();
|
||||
|
||||
if (params.length != 0) {
|
||||
int paramsLength = params.length;
|
||||
for (int loop = paramsLength - 1; loop > 0; loop--) {
|
||||
logger.debug("Param" + loop + ":" + params[loop].getName());
|
||||
}
|
||||
} else {
|
||||
logger.debug(" No params");
|
||||
}
|
||||
|
||||
logger.debug("ReturnType=" + tempMethod.getReturnType().getName());
|
||||
} catch (Exception methodException) {
|
||||
logger.error("Exception : " + methodException.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] addBeforeAfterLogics(ClassPool classPool, String javassistClassName) {
|
||||
public byte[] addBeforeAfterLogics(ClassPool classPool, String javassistClassName) {
|
||||
try {
|
||||
CtClass cc = classPool.get(javassistClassName);
|
||||
CtMethod[] methods = cc.getDeclaredMethods();
|
||||
@@ -118,7 +67,7 @@ public abstract class AbstractModifier {
|
||||
}
|
||||
}
|
||||
|
||||
public static void printClassConvertComplete(String javassistClassName) {
|
||||
public void printClassConvertComplete(String javassistClassName) {
|
||||
logger.info("%s class is converted.", javassistClassName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user