public interface MethodInterceptor
InstanceManager.register(org.apache.felix.ipojo.parser.MethodMetadata, MethodInterceptor)
method.
Events are sent before the method entry (onEntry), after the method returns (onExit),
when an error is thrown by the method (onError), and before the after either a returns or an error (onFinally).
Instead of a Method object, the callbacks received a Member object which can be either a Method
or a Constructor.| Modifier and Type | Method and Description |
|---|---|
void |
onEntry(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Object[] args)
This method is called when a thread enters in a method.
|
void |
onError(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Throwable throwable)
This method is called when the execution throws an exception in the given
method.
|
void |
onExit(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Object returnedObj)
This method is called when the execution exits a method :
before a
return. |
void |
onFinally(java.lang.Object pojo,
java.lang.reflect.Member method)
This method is called when the execution of a method is going to terminate :
just before to throw an exception or before to return.
|
void onEntry(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Object[] args)
pojo - the pojo on which the method is called.method - the invoked method.args - the arguments array.void onExit(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Object returnedObj)
return.
If the given returned object is null, either the method is
void, or it returns null.
This method must not modify the returned object.pojo - the pojo on which the method exits.method - the exiting method.returnedObj - the the returned object (boxed for primitive type)void onError(java.lang.Object pojo,
java.lang.reflect.Member method,
java.lang.Throwable throwable)
pojo - the pojo on which the method was accessed.method - the invoked method.throwable - the thrown exceptionvoid onFinally(java.lang.Object pojo,
java.lang.reflect.Member method)
pojo - the pojo on which the method was accessed.method - the invoked method.Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.