Class Instrumenter.MethodExitHookBuilder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.Instrumenter.MethodExitHookBuilder
-
- Enclosing class:
- Instrumenter
public static class Instrumenter.MethodExitHookBuilder extends Object
Fluent builder for a method exit hook.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instrumenter.MethodExitHookBuilderallowModification()Lets the hook replace the returned value.Instrumenter.MethodExitHookBuildercallStatic(String owner, String name, String descriptor)Sets the static method the hook dispatches to.Instrumenter.MethodExitHookBuilderinClass(String className)Restricts this hook to a single class.Instrumenter.MethodExitHookBuilderinPackage(String packagePrefix)Restricts this hook to classes under a package.Instrumenter.MethodExitHookBuildermatchingMethod(String pattern)Restricts this hook to methods whose name matches a pattern.Instrumenter.MethodExitHookBuilderpriority(int priority)Sets the ordering priority of this hook against others at the same site.Instrumenterregister()Attaches the collected filters and registers the hook.Instrumenter.MethodExitHookBuilderwithClassName()Passes the enclosing class name as a hook argument.Instrumenter.MethodExitHookBuilderwithMethodName()Passes the instrumented method name as a hook argument.Instrumenter.MethodExitHookBuilderwithReturnValue()Passes the value being returned as a hook argument.Instrumenter.MethodExitHookBuilderwithThis()Passes the receiver as a hook argument.
-
-
-
Method Detail
-
inClass
public Instrumenter.MethodExitHookBuilder inClass(String className)
Restricts this hook to a single class.- Parameters:
className- the internal class name- Returns:
- this builder
-
inPackage
public Instrumenter.MethodExitHookBuilder inPackage(String packagePrefix)
Restricts this hook to classes under a package.- Parameters:
packagePrefix- the internal package name prefix- Returns:
- this builder
-
matchingMethod
public Instrumenter.MethodExitHookBuilder matchingMethod(String pattern)
Restricts this hook to methods whose name matches a pattern.- Parameters:
pattern- the method name pattern- Returns:
- this builder
-
callStatic
public Instrumenter.MethodExitHookBuilder callStatic(String owner, String name, String descriptor)
Sets the static method the hook dispatches to.- Parameters:
owner- internal name of the class declaring the hook methodname- the hook method namedescriptor- the hook method descriptor- Returns:
- this builder
-
withThis
public Instrumenter.MethodExitHookBuilder withThis()
Passes the receiver as a hook argument.- Returns:
- this builder
-
withClassName
public Instrumenter.MethodExitHookBuilder withClassName()
Passes the enclosing class name as a hook argument.- Returns:
- this builder
-
withMethodName
public Instrumenter.MethodExitHookBuilder withMethodName()
Passes the instrumented method name as a hook argument.- Returns:
- this builder
-
withReturnValue
public Instrumenter.MethodExitHookBuilder withReturnValue()
Passes the value being returned as a hook argument.- Returns:
- this builder
-
allowModification
public Instrumenter.MethodExitHookBuilder allowModification()
Lets the hook replace the returned value.- Returns:
- this builder
-
priority
public Instrumenter.MethodExitHookBuilder priority(int priority)
Sets the ordering priority of this hook against others at the same site.- Parameters:
priority- the priority value- Returns:
- this builder
-
register
public Instrumenter register()
Attaches the collected filters and registers the hook.- Returns:
- the instrumenter this builder came from
-
-