Class MethodExitHook
- java.lang.Object
-
- com.tonic.analysis.instrumentation.hook.MethodExitHook
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMethodExitHook.BuilderBuilder forMethodExitHook, defaulting to enabled, priority 100, no values passed and normal returns only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MethodExitHook.Builderbuilder()List<InstrumentationFilter>getFilters()HookDescriptorgetHookDescriptor()intgetPriority()Gets the priority for ordering multiple hooks at the same point.InstrumentationTargetgetTarget()booleanisCanModifyReturn()booleanisEnabled()booleanisInstrumentExceptionalExits()booleanisPassClassName()booleanisPassMethodName()booleanisPassReturnValue()booleanisPassThis()static MethodExitHooksimple(String hookOwner, String hookName, String hookDescriptor)Creates a hook with default settings that calls a static method.
-
-
-
Method Detail
-
getHookDescriptor
public HookDescriptor getHookDescriptor()
- Specified by:
getHookDescriptorin interfaceHook- Returns:
- the hook descriptor
-
getFilters
public List<InstrumentationFilter> getFilters()
- Specified by:
getFiltersin interfaceHook- Returns:
- the filters
-
isEnabled
public boolean isEnabled()
-
getPriority
public int getPriority()
Description copied from interface:HookGets the priority for ordering multiple hooks at the same point.- Specified by:
getPriorityin interfaceHook- Returns:
- the priority
-
isPassThis
public boolean isPassThis()
- Returns:
- whether the
thisreference (null for static methods) is passed to the hook
-
isPassMethodName
public boolean isPassMethodName()
- Returns:
- whether the method name is passed to the hook
-
isPassClassName
public boolean isPassClassName()
- Returns:
- whether the class name is passed to the hook
-
isPassReturnValue
public boolean isPassReturnValue()
- Returns:
- whether the return value (boxed if primitive, null for void) is passed to the hook
-
isCanModifyReturn
public boolean isCanModifyReturn()
- Returns:
- whether the hook can replace the return value (by returning a new one)
-
isInstrumentExceptionalExits
public boolean isInstrumentExceptionalExits()
- Returns:
- whether exceptional exits (in finally blocks) are instrumented
-
getTarget
public InstrumentationTarget getTarget()
-
simple
public static MethodExitHook simple(String hookOwner, String hookName, String hookDescriptor)
Creates a hook with default settings that calls a static method.- Parameters:
hookOwner- internal name of the class declaring the hook methodhookName- the hook method namehookDescriptor- the hook method descriptor- Returns:
- the configured hook
-
builder
public static MethodExitHook.Builder builder()
- Returns:
- a new builder
-
-