mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-20 18:25:55 +10:00
[강운덕] [LUCYSUS-1744] udp socket data receiv
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@574 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -30,6 +30,10 @@ public class JavaAssistClass implements InstrumentClass {
|
||||
this.ctClass = ctClass;
|
||||
}
|
||||
|
||||
public CtClass getCtClass() {
|
||||
return ctClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addInterceptor(String methodName, String[] args, Interceptor interceptor) {
|
||||
return addInterceptor(methodName, args, interceptor, Type.auto);
|
||||
@@ -89,7 +93,8 @@ public class JavaAssistClass implements InstrumentClass {
|
||||
after.append("{");
|
||||
addGetStaticAfterInterceptor(after, id);
|
||||
String target = getTarget(behavior);
|
||||
after.append(" interceptor.after(" + target + ", \"" + ctClass.getName() + "\", \"" + methodName + "\", $args, ($w)$_);");
|
||||
String returnType = getReturnType(behavior);
|
||||
after.append(" interceptor.after(" + target + ", \"" + ctClass.getName() + "\", \"" + methodName + "\", $args, " + returnType + ");");
|
||||
after.append("}");
|
||||
String buildAfter = after.toString();
|
||||
if (logger.isLoggable(Level.INFO)) {
|
||||
@@ -121,6 +126,16 @@ public class JavaAssistClass implements InstrumentClass {
|
||||
}
|
||||
}
|
||||
|
||||
public String getReturnType(CtBehavior behavior) throws NotFoundException {
|
||||
if(behavior instanceof CtMethod) {
|
||||
CtClass returnType = ((CtMethod) behavior).getReturnType();
|
||||
if(CtClass.voidType == returnType) {
|
||||
return "null";
|
||||
}
|
||||
}
|
||||
return "($w)$_";
|
||||
}
|
||||
|
||||
private boolean isStatic(CtBehavior behavior) {
|
||||
int modifiers = behavior.getModifiers();
|
||||
return java.lang.reflect.Modifier.isStatic(modifiers);
|
||||
@@ -287,4 +302,6 @@ public class JavaAssistClass implements InstrumentClass {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user