Annotation Interface SplitInterception
Declares an interception that creates a split in the call tree and optionally an associated payload. The annotated probe method must be public and static and return
String
or Payload
.
You can get information from the intercepted method like parameter values or the instance by declaring parameters annotated with
the annotations from the com.jprofiler.api.probe.injected.parameter package. You can also declare a parameter of type ProbeContext
to
open or close control objects or check if the probe is currently being recorded.
If you return a Payload
to specify control objects or custom event types, you must declare a parameter of type ProbeContext
and create the returned object with
ProbeContext.createPayload(String, Object, Enum)
.
If you don't want to create a split for the current invocation, the probe method can return null
.
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionSpecifies the method that should be intercepted. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
If payloads should also be recorded if the method throws an exception.boolean
If payloads should be created in addition to the call tree split.boolean
Indicates if your interception is reentrant.
-
Element Details
-
method
MethodSpec methodSpecifies the method that should be intercepted.- Returns:
- a method specification
-
-
-
payloads
boolean payloadsIf payloads should be created in addition to the call tree split.- Returns:
- if payloads should be created.
- Default:
- true
-
reentrant
boolean reentrantIndicates if your interception is reentrant. Iffalse
, the probe method will not be called for recursive invocations of the intercepted method and only one split will be created.If
true
, splits will be nested, but only one payload will be created for the outermost call.- Returns:
- if your probe method should be called for recursive invocations
- Default:
- false
-
exceptionPayloads
boolean exceptionPayloadsIf payloads should also be recorded if the method throws an exception.- Returns:
- if payloads should be recorded for exceptional exits
- Default:
- false
-