Interface MethodMonitor

All Known Implementing Classes:
MethodMonitorBase

public interface MethodMonitor
Interface representing some action that takes place on entry and exit to a method that is being traced.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Provided for MethodMonitor instances that maintain state.
    Returns the contents of this method monitor.
    void
    enter(int ident, Object... args)
    Invoked at the start of a method, before any actions in the method take place.
    void
    exception(int ident, Throwable thr)
    Called to report an exception that is thrown in the method.
    void
    exit(int ident)
    An exit from a method that has a void return type.
    void
    exit(int ident, Object result)
    An exit from a method that has a non-void return type.
    Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.
    void
    info(Object[] args, int callerIdent, int selfIdent)
    Invoked anywhere in the method after enter and before exit, to indicate some useful tracing information in the method.
    The class for which this MethodMonitor is defined.
     
  • Method Details

    • myClass

      Class<?> myClass()
      The class for which this MethodMonitor is defined.
      Returns:
      The class of this MethodMonitor.
    • enter

      void enter(int ident, Object... args)
      Invoked at the start of a method, before any actions in the method take place.
      Parameters:
      ident - The method identifier.
      args - The arguments passed into the method.
    • info

      void info(Object[] args, int callerIdent, int selfIdent)
      Invoked anywhere in the method after enter and before exit, to indicate some useful tracing information in the method.
      Parameters:
      args - Any information needed in the info call.
      callerIdent - The identifier of the method calling the InfoMethod.
      selfIdent - The identifier of the InfoMethod itself.
    • exit

      void exit(int ident)
      An exit from a method that has a void return type. Called as the last operation in the method.
      Parameters:
      ident - The method identifier.
    • exit

      void exit(int ident, Object result)
      An exit from a method that has a non-void return type. Called as the last operation in the method. result will be null if the method terminates by throwing an exception.
      Parameters:
      ident - The method identifier.
      result - The method result.
    • exception

      void exception(int ident, Throwable thr)
      Called to report an exception that is thrown in the method. If the method throws and catches the exception, it will still be reported.
      Parameters:
      ident - The method identifier.
      thr - The exception that terminates the method.
    • clear

      void clear()
      Provided for MethodMonitor instances that maintain state. Simply removes the state and resets the MethodMonitor to its initial state.
    • contents

      Returns the contents of this method monitor. If it is a composite method monitor, all the component MethoMonitor instances are returned. If it is a single MethodMonitor, it just returns itself. It is required that a composite method monitor only return MethodMonitor instances which are not themselves composite.
    • factory

      Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.
    • name

      String name()