Class Instrumenter.ExceptionHookBuilder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.Instrumenter.ExceptionHookBuilder
-
- Enclosing class:
- Instrumenter
public static class Instrumenter.ExceptionHookBuilder extends Object
Fluent builder for an exception handler hook.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instrumenter.ExceptionHookBuildercallStatic(String owner, String name, String descriptor)Sets the static method the hook dispatches to.Instrumenter.ExceptionHookBuildercanSuppress()Lets the hook swallow the exception instead of rethrowing it.Instrumenter.ExceptionHookBuilderforExceptionType(String exceptionType)Restricts this hook to handlers of one exception type.Instrumenter.ExceptionHookBuilderinClass(String className)Restricts this hook to a single class.Instrumenter.ExceptionHookBuilderinPackage(String packagePrefix)Restricts this hook to classes under a package.Instrumenter.ExceptionHookBuilderpriority(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.ExceptionHookBuilderwithClassName()Passes the enclosing class name as a hook argument.Instrumenter.ExceptionHookBuilderwithException()Passes the caught exception as a hook argument.Instrumenter.ExceptionHookBuilderwithMethodName()Passes the enclosing method name as a hook argument.
-
-
-
Method Detail
-
inClass
public Instrumenter.ExceptionHookBuilder inClass(String className)
Restricts this hook to a single class.- Parameters:
className- the internal class name- Returns:
- this builder
-
inPackage
public Instrumenter.ExceptionHookBuilder inPackage(String packagePrefix)
Restricts this hook to classes under a package.- Parameters:
packagePrefix- the internal package name prefix- Returns:
- this builder
-
forExceptionType
public Instrumenter.ExceptionHookBuilder forExceptionType(String exceptionType)
Restricts this hook to handlers of one exception type.- Parameters:
exceptionType- the internal exception class name- Returns:
- this builder
-
callStatic
public Instrumenter.ExceptionHookBuilder 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
-
withException
public Instrumenter.ExceptionHookBuilder withException()
Passes the caught exception as a hook argument.- Returns:
- this builder
-
withMethodName
public Instrumenter.ExceptionHookBuilder withMethodName()
Passes the enclosing method name as a hook argument.- Returns:
- this builder
-
withClassName
public Instrumenter.ExceptionHookBuilder withClassName()
Passes the enclosing class name as a hook argument.- Returns:
- this builder
-
canSuppress
public Instrumenter.ExceptionHookBuilder canSuppress()
Lets the hook swallow the exception instead of rethrowing it.- Returns:
- this builder
-
priority
public Instrumenter.ExceptionHookBuilder 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
-
-