|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface InterfaceMonitor
allows to monitor all method calls to an object through a proxy object based on a specified interface. The specified methods are executed within the same thread as the call to the proxy object that handles the method calls.
InterfaceWrapper,
PerformanceMonitor| Nested Class Summary | |
|---|---|
static class |
InterfaceMonitor.Adapter
a helper class to facilitate the implementation of the enclosing interface |
static class |
InterfaceMonitor.IMLogger
a convenience class that simply logs all access to an interface |
static class |
InterfaceMonitor.Profiler
allows to profile the access to an interface |
| Method Summary | |
|---|---|
void |
methodInvoked(Object object,
Method method,
Object[] args,
long timeTaken,
Object returnValue,
Throwable throwable)
called after the given method on the given object with the given arguments has been executed. |
Throwable |
prepareInvocation(Object object,
Method method,
Object[] args)
called before the given method is executed on the given object with the given parameters. |
| Method Detail |
|---|
Throwable prepareInvocation(Object object,
Method method,
Object[] args)
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.
object - the original object that the given method is going to be executed on
(if null is returned on this method)method - the method that is to be executed on the given objectargs - the arguments that are to be used for the given method execution (may be null)
void methodInvoked(Object object,
Method method,
Object[] args,
long timeTaken,
Object returnValue,
Throwable throwable)
object - the original object that the given method was invoked onmethod - the method that was executed on the given objectargs - the arguments that were used for the given method call (may be null)timeTaken - the time it took to execute the given method in millisecondsreturnValue - the value returned by the given method call (if no exception was thrown; otherwise null)throwable - contains the exception thrown by the given method call (if any);
if the Throwable is null, the returnValue is not and vice versa.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||