Package org.glassfish.pfl.tf.spi
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 TypeMethodDescriptionvoid
clear()
Provided for MethodMonitor instances that maintain state.contents()
Returns the contents of this method monitor.void
Invoked at the start of a method, before any actions in the method take place.void
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
An exit from a method that has a non-void return type.factory()
Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.void
Invoked anywhere in the method after enter and before exit, to indicate some useful tracing information in the method.Class
<?> myClass()
The class for which this MethodMonitor is defined.name()
-
Method Details
-
myClass
Class<?> myClass()The class for which this MethodMonitor is defined.- Returns:
- The class of this MethodMonitor.
-
enter
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
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
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
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
Collection<MethodMonitor> 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
MethodMonitorFactory factory()Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor. -
name
String name()
-