The Target object is a specification of the classes and methods to which the probe should be applied. The default is to apply the probe to all instrumented classes and methods.
The Target object is optional. When no Target is specified, the probe will be applied to all instrumented classes and methods.
The Target object lets you specify patterns to match against the package name, class name, and method name, plus the method's signature, of each method the instrumentation engine sees. The patterns can contain wildcards, where "*" will match zero or more characters. If a Target’s wildcard patterns match a method’s package, class, name and signature, the type property determines whether the method is instrumented (include) or not (exclude).
The Target object includes the following properties:| type | Required. The type property determines whether or not a probe is applied to a target method. Specify include to apply the probe to classes and methods that match the wildcard patterns, exclude to exclude them. |
| package | Specify a wildcard pattern to match against the package portion of class names. For example: java.util* will match every class in the java.util package and its subpackages. |
| class | Specify a wildcard pattern to match against class names. |
| method | Specify a wildcard pattern to match against method names. |
| signature | Specify a wildcard pattern to match against a method’s signature - that is, the string representing the method's arguments and return type. This is in the Java internal format for method signatures. For example: (Ljava/lang/Object;)D is the signature of a method that takes an Object as a parameter and returns a double. This wildcard pattern can be used to distinguish among overloaded methods. |
Notes:
<target type="include" package="com.example" class="*Proxy" method="Get*" />
Contained by
The Probe object