@Test public void testCleansUpContextAfterProcessing() throws Exception { encodedContext.put("contextFromMessage", "yes"); unit.intercept(invocationContext); assertThat(backend.isEmpty(), is(true)); verify(mdbLike).onMessage(message); }
@AroundInvoke public Object intercept(final InvocationContext ctx) throws Exception { final boolean isMdbInvocation = isMessageListenerOnMessageMethod(ctx.getMethod()); try { if (isMdbInvocation) { beforeProcessing(extractMessageParameter(ctx.getParameters())); } return ctx.proceed(); } finally { if (isMdbInvocation) { cleanUp(); } } }
TraceeMessageListener { @AroundInvoke public Object intercept(final InvocationContext ctx) throws Exception { final boolean isMdbInvocation = isMessageListenerOnMessageMethod(ctx.getMethod()); try { if (isMdbInvocation) { beforeProcessing(extractMessageParameter(ctx.getParameters())); } return ctx.proceed(); } finally { if (isMdbInvocation) { cleanUp(); } } } }
TraceeMessageListener { @AroundInvoke public Object intercept(final InvocationContext ctx) throws Exception { final boolean isMdbInvocation = isMessageListenerOnMessageMethod(ctx.getMethod()); try { if (isMdbInvocation) { beforeProcessing(extractMessageParameter(ctx.getParameters())); } return ctx.proceed(); } finally { if (isMdbInvocation) { cleanUp(); } } } TraceeMessageListener(TraceeBackend backend); @SuppressWarnings("unused")  TraceeMessageListener(); }
TraceeMessageListener { @AroundInvoke public Object intercept(final InvocationContext ctx) throws Exception { final boolean isMdbInvocation = isMessageListenerOnMessageMethod(ctx.getMethod()); try { if (isMdbInvocation) { beforeProcessing(extractMessageParameter(ctx.getParameters())); } return ctx.proceed(); } finally { if (isMdbInvocation) { cleanUp(); } } } TraceeMessageListener(TraceeBackend backend); @SuppressWarnings("unused")  TraceeMessageListener(); @AroundInvoke Object intercept(final InvocationContext ctx); @SuppressWarnings("unchecked") void beforeProcessing(final Message message); }
TraceeMessageListener { @AroundInvoke public Object intercept(final InvocationContext ctx) throws Exception { final boolean isMdbInvocation = isMessageListenerOnMessageMethod(ctx.getMethod()); try { if (isMdbInvocation) { beforeProcessing(extractMessageParameter(ctx.getParameters())); } return ctx.proceed(); } finally { if (isMdbInvocation) { cleanUp(); } } } TraceeMessageListener(TraceeBackend backend); @SuppressWarnings("unused")  TraceeMessageListener(); @AroundInvoke Object intercept(final InvocationContext ctx); @SuppressWarnings("unchecked") void beforeProcessing(final Message message);  }