Holger's
Java API

com.antelmann.util
Class InterfaceMonitor.Adapter

java.lang.Object
  extended by com.antelmann.util.InterfaceMonitor.Adapter
All Implemented Interfaces:
InterfaceMonitor
Direct Known Subclasses:
InterfaceMonitor.IMLogger, InterfaceMonitor.Profiler, PerformanceMonitor
Enclosing interface:
InterfaceMonitor

public static class InterfaceMonitor.Adapter
extends Object
implements InterfaceMonitor

a helper class to facilitate the implementation of the enclosing interface


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.util.InterfaceMonitor
InterfaceMonitor.Adapter, InterfaceMonitor.IMLogger, InterfaceMonitor.Profiler
 
Constructor Summary
InterfaceMonitor.Adapter()
           
 
Method Summary
 void methodInvoked(Object obj, Method m, Object[] args, long timeTaken, Object returnValue, Throwable t)
          called after the given method on the given object with the given arguments has been executed.
 Throwable prepareInvocation(Object obj, Method m, Object[] args)
          called before the given method is executed on the given object with the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterfaceMonitor.Adapter

public InterfaceMonitor.Adapter()
Method Detail

prepareInvocation

public Throwable prepareInvocation(Object obj,
                                   Method m,
                                   Object[] args)
Description copied from interface: InterfaceMonitor
called before the given method is executed on the given object with the given parameters. If the given method is to be called, this method is to return null to allow the method to be executed; in this case, the methodInvoked method of this interface is called after the invocation is done. If the return value is not null, the returned exception is directly thrown instead of invoking the given method; this way, method invocation can be prevented.

Specified by:
prepareInvocation in interface InterfaceMonitor
Parameters:
obj - the original object that the given method is going to be executed on (if null is returned on this method)
m - the method that is to be executed on the given object
args - the arguments that are to be used for the given method execution (may be null)
Returns:
null if the method is to be called and an exception to be thrown instead of the method call

methodInvoked

public void methodInvoked(Object obj,
                          Method m,
                          Object[] args,
                          long timeTaken,
                          Object returnValue,
                          Throwable t)
Description copied from interface: InterfaceMonitor
called after the given method on the given object with the given arguments has been executed. Of the last two arguments, one is always null while the other contains a value. Note that this method is synchronously called before the return value (or the exception to be thrown) is passed to the caller of the proxy object.

Specified by:
methodInvoked in interface InterfaceMonitor
Parameters:
obj - the original object that the given method was invoked on
m - the method that was executed on the given object
args - the arguments that were used for the given method call (may be null)
timeTaken - the time it took to execute the given method in milliseconds
returnValue - the value returned by the given method call (if no exception was thrown; otherwise null)
t - contains the exception thrown by the given method call (if any); if the Throwable is null, the returnValue is not and vice versa.


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads