-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
999ef22
commit 259d495
Showing
5 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
dubbo-test-instrument/src/main/java/com/hello/DubboUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hello; | ||
|
||
import org.apache.dubbo.rpc.Invocation; | ||
|
||
/** | ||
* | ||
* <pre> | ||
* 在instrument.properties 里通过define字段指定的类,会在运行时define到应用的ClassLoader里。 | ||
* 可以在增强的代码里直接使用 | ||
* </pre> | ||
*/ | ||
public class DubboUtils { | ||
|
||
public static void test(Invocation invocation) { | ||
System.err.println("DubboUtils: " + invocation.getServiceName()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
dubbo-test-instrument/src/main/resources/instrument.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
instrument=org.apache.dubbo.monitor.support.MonitorFilter,org.apache.dubbo.rpc.test.Invoker | ||
instrument=org.apache.dubbo.monitor.support.MonitorFilter,org.apache.dubbo.rpc.test.Invoker | ||
define=com.hello.DubboUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters