Class ExceptionHook.Builder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.hook.ExceptionHook.Builder
-
- Enclosing class:
- ExceptionHook
public static class ExceptionHook.Builder extends Object
Fluent builder forExceptionHookinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptionHookbuild()Builds the configured exception hook.ExceptionHook.BuildercanSuppress(boolean canSuppress)Sets whether the hook can suppress the exception by returning true.ExceptionHook.Builderenabled(boolean enabled)Sets whether the hook is active.ExceptionHook.BuilderexceptionType(String exceptionType)Sets the exception type to intercept; null intercepts all types.ExceptionHook.Builderfilters(List<InstrumentationFilter> filters)Sets the filters that restrict which code is instrumented.ExceptionHook.BuilderhookDescriptor(HookDescriptor hookDescriptor)Sets the hook method invoked in each instrumented exception handler.ExceptionHook.BuilderpassClassName(boolean passClassName)Sets whether the enclosing class name is passed to the hook.ExceptionHook.BuilderpassException(boolean passException)Sets whether the exception object is passed to the hook.ExceptionHook.BuilderpassMethodName(boolean passMethodName)Sets whether the enclosing method name is passed to the hook.ExceptionHook.Builderpriority(int priority)Sets the ordering priority relative to other hooks.
-
-
-
Method Detail
-
hookDescriptor
public ExceptionHook.Builder hookDescriptor(HookDescriptor hookDescriptor)
Sets the hook method invoked in each instrumented exception handler.- Parameters:
hookDescriptor- the hook method descriptor- Returns:
- this builder
-
filters
public ExceptionHook.Builder filters(List<InstrumentationFilter> filters)
Sets the filters that restrict which code is instrumented.- Parameters:
filters- the instrumentation filters- Returns:
- this builder
-
enabled
public ExceptionHook.Builder enabled(boolean enabled)
Sets whether the hook is active.- Parameters:
enabled- true to enable the hook- Returns:
- this builder
-
priority
public ExceptionHook.Builder priority(int priority)
Sets the ordering priority relative to other hooks.- Parameters:
priority- the priority value- Returns:
- this builder
-
exceptionType
public ExceptionHook.Builder exceptionType(String exceptionType)
Sets the exception type to intercept; null intercepts all types.- Parameters:
exceptionType- the exception type (internal name)- Returns:
- this builder
-
passException
public ExceptionHook.Builder passException(boolean passException)
Sets whether the exception object is passed to the hook.- Parameters:
passException- true to pass the exception- Returns:
- this builder
-
passMethodName
public ExceptionHook.Builder passMethodName(boolean passMethodName)
Sets whether the enclosing method name is passed to the hook.- Parameters:
passMethodName- true to pass the method name- Returns:
- this builder
-
passClassName
public ExceptionHook.Builder passClassName(boolean passClassName)
Sets whether the enclosing class name is passed to the hook.- Parameters:
passClassName- true to pass the class name- Returns:
- this builder
-
canSuppress
public ExceptionHook.Builder canSuppress(boolean canSuppress)
Sets whether the hook can suppress the exception by returning true.- Parameters:
canSuppress- true to let the hook suppress the exception- Returns:
- this builder
-
build
public ExceptionHook build()
Builds the configured exception hook.- Returns:
- the new hook
-
-