Class MethodEntryHook

  • All Implemented Interfaces:
    Hook

    public class MethodEntryHook
    extends Object
    implements Hook
    Configuration for method entry instrumentation.
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface Hook
        Returns:
        whether enabled
      • getPriority

        public int getPriority()
        Description copied from interface: Hook
        Gets the priority for ordering multiple hooks at the same point.
        Specified by:
        getPriority in interface Hook
        Returns:
        the priority
      • isPassThis

        public boolean isPassThis()
        Returns:
        true if the receiver, null for static methods, is passed to the hook
      • isPassMethodName

        public boolean isPassMethodName()
        Returns:
        true if the instrumented method's name is passed to the hook
      • isPassClassName

        public boolean isPassClassName()
        Returns:
        true if the instrumented class's name is passed to the hook
      • isPassAllParameters

        public boolean isPassAllParameters()
        Returns:
        true if every parameter is passed to the hook as one Object array
      • getParameterIndices

        public List<Integer> getParameterIndices()
        Returns:
        the individual parameter positions to pass, boxed when primitive
      • simple

        public static MethodEntryHook simple​(String hookOwner,
                                             String hookName,
                                             String hookDescriptor)
        Creates a hook that calls a static method with no filters and no extra arguments.
        Parameters:
        hookOwner - the internal name of the class declaring the hook method
        hookName - the hook method name
        hookDescriptor - the hook method descriptor
        Returns:
        the configured hook