jfun.yan.monitoring
Interface FunctionMonitor


public interface FunctionMonitor

This interface represents something that monitors the invocation of a function.

Author:
Michelle Lei

Method Summary
 void called(Function f, java.lang.Object[] args, java.lang.Object result, long duration)
          This method is called right after the function is called successfully.
 void callFailed(Function f, java.lang.Object[] args, java.lang.Throwable err, long duration)
          This method is called after the function failed.
 void calling(Function f, java.lang.Object[] args)
          This method is called right before the function is called.
 

Method Detail

calling

void calling(Function f,
             java.lang.Object[] args)
This method is called right before the function is called.

Parameters:
f - the function to be called.
args - the arguments passed to the function.

called

void called(Function f,
            java.lang.Object[] args,
            java.lang.Object result,
            long duration)
This method is called right after the function is called successfully.

Parameters:
f - the function.
args - the arguments passed to the function.
result - the value returned by the function.
duration - excactly how long the function call takes. (in milliseconds)

callFailed

void callFailed(Function f,
                java.lang.Object[] args,
                java.lang.Throwable err,
                long duration)
This method is called after the function failed.

Parameters:
f - the function.
args - the arguments passed to the function.
err - the exception thrown out of the function.
duration - exactly how long the function call takes. (in milliseconds)