org.glassfish.gmbal.generic
Interface MethodMonitor


public interface MethodMonitor

General interface used to add observability to method execution. This may be used for many purposes, for example:

Note that tools like DTrace and btrace (and glassfish probes) can provide most of this capability at less cost in programming. However, there are some advantages to this approach: Obviously there are some disadvantages as well. This includes some runtime overhead (small if no action is registered), as well as the extra effort in putting such calls in all of the appropriate points. However, there are too many cases (IIOP marshalling, portable interceptors, the Gmbal typelib) where detailed, carefully-controlled logging is the only effective way to diagnose complex problems.

Author:
Ken Cavanaugh

Method Summary
 void clear()
          Clear any accummulated data.
 void enter(boolean enabled, String name, Object... args)
          Make information about the beginning of a method available.
 void exit(boolean enabled)
          Indicate that the current method has finished with no result.
 void exit(boolean enabled, Object result)
          Indicate that the current method has finished with a result.
 void info(boolean enabled, Object... args)
          Information to accummulate about the current method.
 

Method Detail

enter

void enter(boolean enabled,
           String name,
           Object... args)
Make information about the beginning of a method available.

Parameters:
enabled - Indicates whether or not data collection is enabled. Some implementations may choose to ignore this.
name - The name of the method.
args - Some or all of the arguments passed to the method.

info

void info(boolean enabled,
          Object... args)
Information to accummulate about the current method.

Parameters:
args - The data to accummulate.

exit

void exit(boolean enabled)
Indicate that the current method has finished with no result.


exit

void exit(boolean enabled,
          Object result)
Indicate that the current method has finished with a result.

Parameters:
result - The result of this method call.

clear

void clear()
Clear any accummulated data.



Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.