/** * Always applies the interceptor if the "trackAllInvocations" flag has been set; * else just kicks in if the log is enabled. * @see #setTrackAllInvocations * @see #isLogEnabled */ @Override protected boolean isInterceptorEnabled(MethodInvocation invocation, Log logger) { return (this.trackAllInvocations || isLogEnabled(logger)); }
/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }
/** * Always applies the interceptor if the "trackAllInvocations" flag has been set; * else just kicks in if the log is enabled. * @see #setTrackAllInvocations * @see #isLogEnabled */ @Override protected boolean isInterceptorEnabled(MethodInvocation invocation, Log logger) { return (this.trackAllInvocations || isLogEnabled(logger)); }
/** * Always applies the interceptor if the "trackAllInvocations" flag has been set; * else just kicks in if the log is enabled. * @see #setTrackAllInvocations * @see #isLogEnabled */ @Override protected boolean isInterceptorEnabled(MethodInvocation invocation, Log logger) { return (this.trackAllInvocations || isLogEnabled(logger)); }
/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }
/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }