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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Provided for MethodMonitor instances that maintain state.java.util.Collection<MethodMonitor>
contents()
Returns the contents of this method monitor.void
enter(int ident, java.lang.Object... args)
Invoked at the start of a method, before any actions in the method take place.void
exception(int ident, java.lang.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, java.lang.Object result)
An exit from a method that has a non-void return type.MethodMonitorFactory
factory()
Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.void
info(java.lang.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.java.lang.Class<?>
myClass()
The class for which this MethodMonitor is defined.java.lang.String
name()
-
-
-
Method Detail
-
myClass
java.lang.Class<?> myClass()
The class for which this MethodMonitor is defined.- Returns:
- The class of this MethodMonitor.
-
enter
void enter(int ident, java.lang.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(java.lang.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:
callerIdent
- The identifier of the method calling the InfoMethod.selfIdent
- The identifier of the InfoMethod itself.args
- Any information needed in the info call.
-
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, java.lang.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, java.lang.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
java.util.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
java.lang.String name()
-
-