@Test public void testMonitoringAsynchronousCdi() throws Exception { final Counter ejbCounter = MonitoringProxy.getEjbCounter(); ejbCounter.clear(); final MonitoringAsynchronousCdiInterceptor interceptor = new MonitoringAsynchronousCdiInterceptor(); ejbCounter.setDisplayed(true); interceptor.intercept(new InvokeContext(false)); assertSame("requestsCount", 1, ejbCounter.getRequestsCount()); }
@AroundInvoke public Object intercept(InvocationContext context) throws Exception { if (DISABLED || !EJB_COUNTER.isDisplayed()) { return context.proceed(); } final String requestName = getRequestName(context); boolean systemError = false; try { EJB_COUNTER.bindContextIncludingCpu(requestName); return context.proceed(); } catch (final Error e) { systemError = true; throw e; } finally { EJB_COUNTER.addRequestForCurrentContext(systemError); } }
MonitoringInterceptor implements Serializable { @AroundInvoke public Object intercept(InvocationContext context) throws Exception { if (DISABLED || !EJB_COUNTER.isDisplayed()) { return context.proceed(); } final String requestName = getRequestName(context); boolean systemError = false; try { EJB_COUNTER.bindContextIncludingCpu(requestName); return context.proceed(); } catch (final Error e) { systemError = true; throw e; } finally { EJB_COUNTER.addRequestForCurrentContext(systemError); } } }
MonitoringInterceptor implements Serializable { @AroundInvoke public Object intercept(InvocationContext context) throws Exception { if (DISABLED || !EJB_COUNTER.isDisplayed()) { return context.proceed(); } final String requestName = getRequestName(context); boolean systemError = false; try { EJB_COUNTER.bindContextIncludingCpu(requestName); return context.proceed(); } catch (final Error e) { systemError = true; throw e; } finally { EJB_COUNTER.addRequestForCurrentContext(systemError); } } MonitoringInterceptor(); }
MonitoringInterceptor implements Serializable { @AroundInvoke public Object intercept(InvocationContext context) throws Exception { if (DISABLED || !EJB_COUNTER.isDisplayed()) { return context.proceed(); } final String requestName = getRequestName(context); boolean systemError = false; try { EJB_COUNTER.bindContextIncludingCpu(requestName); return context.proceed(); } catch (final Error e) { systemError = true; throw e; } finally { EJB_COUNTER.addRequestForCurrentContext(systemError); } } MonitoringInterceptor(); @AroundInvoke Object intercept(InvocationContext context); }
MonitoringInterceptor implements Serializable { @AroundInvoke public Object intercept(InvocationContext context) throws Exception { if (DISABLED || !EJB_COUNTER.isDisplayed()) { return context.proceed(); } final String requestName = getRequestName(context); boolean systemError = false; try { EJB_COUNTER.bindContextIncludingCpu(requestName); return context.proceed(); } catch (final Error e) { systemError = true; throw e; } finally { EJB_COUNTER.addRequestForCurrentContext(systemError); } } MonitoringInterceptor(); @AroundInvoke Object intercept(InvocationContext context);  }