net.bull.javamelody
Class MonitoringProxy
java.lang.Object
net.bull.javamelody.MonitoringProxy
- All Implemented Interfaces:
- java.io.Serializable, java.lang.reflect.InvocationHandler
public final class MonitoringProxy
- extends java.lang.Object
- implements java.lang.reflect.InvocationHandler, java.io.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:
facade = MonitoringProxy.createProxy(facade);
- Author:
- Emeric Vernat
- See Also:
- Serialized Form
|
Method Summary |
static
|
createProxy(T facade)
|
static
|
createProxy(T facade,
java.lang.String name)
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Intercepte une exécution de méthode sur une façade. |
| 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
createProxy
public static <T> T createProxy(T facade,
java.lang.String name)
- Type Parameters:
T - Type de la façade (une interface en général).- Parameters:
facade - Instance de la façadename - override of the interface name in the statistics
- Returns:
- Proxy de la façade
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Intercepte une exécution de méthode sur une façade.
- Specified by:
invoke in interface java.lang.reflect.InvocationHandler
- Parameters:
proxy - Objectmethod - Methodargs - Object[]
- Returns:
- Object
- Throws:
java.lang.Throwable - t
Copyright © 2008-2010 Emeric Vernat. All Rights Reserved.