net.bull.javamelody
Class MonitoringProxy
java.lang.Object
net.bull.javamelody.MonitoringProxy
- All Implemented Interfaces:
- Serializable, InvocationHandler
public final class MonitoringProxy
- extends Object
- implements InvocationHandler, Serializable
Proxy de monitoring pour tout façade ayant une interface.
Il est destiné à un compteur pour les statistiques d'exécutions de méthodes sur les "façades métiers"
qui ne sont ni EJB 3 ni Spring.
Il s'utilise comme ceci (penser aussi à activer le compteur "services" comme celui pour "ejb") :
facade = MonitoringProxy.createProxy(facade);
- Author:
- Emeric Vernat
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createProxy
public static <T> T createProxy(T facade)
- Type Parameters:
T - Type de la façade (une interface en général).- Parameters:
facade - Instance de la façade
- Returns:
- Proxy de la façade
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Intercepte une exécution de méthode sur une façade.
- Specified by:
invoke in interface InvocationHandler
- Parameters:
proxy - Objectmethod - Methodargs - Object[]
- Returns:
- Object
- Throws:
Throwable - t
Copyright © 2008-2010 Emeric Vernat. All Rights Reserved.