Package net.bull.javamelody
Class MonitoringProxy
java.lang.Object
net.bull.javamelody.MonitoringProxy
- All Implemented Interfaces:
Serializable,InvocationHandler
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:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMonitoringProxy(Object facade) Constructeur privé : instanciation pour méthode createProxy ci-dessous.protectedMonitoringProxy(Object facade, String name) Constructeur privé : instanciation pour méthode createProxy ci-dessous. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcreateProxy(T facade) Création d'un proxy de monitoring pour une façade.static <T> TcreateProxy(T facade, String name) Création d'un proxy de monitoring pour une façade, en spécifiant le nom qui sera affiché dans le monitoring.protected static <T> TcreateProxy(T facade, MonitoringProxy monitoringProxy) protected StringgetName()protected StringgetRequestName(Method method) Intercepte une exécution de méthode sur une façade.static ObjectinvokeTarget(Object target, Method method, Object[] args, String requestName) Invoke target.
-
Constructor Details
-
MonitoringProxy
Constructeur privé : instanciation pour méthode createProxy ci-dessous.- Parameters:
facade- Object
-
MonitoringProxy
Constructeur privé : instanciation pour méthode createProxy ci-dessous.- Parameters:
facade- Objectname- override of the interface name in the statistics
-
-
Method Details
-
createProxy
public static <T> T createProxy(T facade) Création d'un proxy de monitoring pour une façade.- 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
Création d'un proxy de monitoring pour une façade, en spécifiant le nom qui sera affiché dans le monitoring.- 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
Intercepte une exécution de méthode sur une façade.- Specified by:
invokein interfaceInvocationHandler- Parameters:
proxy- Objectmethod- Methodargs- Object[]- Returns:
- Object
- Throws:
Throwable- t
-
invokeTarget
public static Object invokeTarget(Object target, Method method, Object[] args, String requestName) throws IllegalAccessException, InvocationTargetException Invoke target.- Parameters:
target- Instance to callmethod- Method to callargs- Method argumentsrequestName- Request name to display- Returns:
- Result
- Throws:
IllegalAccessException- eInvocationTargetException- e
-
getRequestName
-
getName
-
createProxy
-