Thankfully the JAMon API MonProxy object has a "getMonitoredObject()" method through which I could get hold of the OracleConnection object and use it.
Here is the sample code snippet: (just in case someone else needs it :)
// we need to do this as the 'setEndToEndMetrics'
// method is only available on an OracleConnection.
if (Proxy.isProxyClass(connection.getClass()))// if a dynamic proxy object
{
InvocationHandler invocationHandler =
Proxy.getInvocationHandler(connection);
Object monitoredObject =
(MonProxy) invocationHandler).getMonitoredObject();
((OracleConnection) monitoredObject).
setEndToEndMetrics(metrics, (short) 0);
}
No comments:
Post a Comment