@Test public void testOnMessage() throws Exception { final Serializable param1 = null; final Serializable[] params = new Serializable[1]; params[0] = param1; final String actionKey = "TestAction"; context.checking(new Expectations() { { oneOf((ObjectMessage) messageMock).getObject(); will(returnValue(userActionRequestMock)); oneOf(userActionRequestMock).getActionKey(); will(returnValue(actionKey)); oneOf(taskHandler).handleTask(userActionRequestMock); } }); sut.onMessage(messageMock); context.assertIsSatisfied(); }
@Override public void onMessage(final Message message) { try { if (message instanceof ObjectMessage) { log.debug("message received is of ObjectMessage type."); ObjectMessage objectMessage = (ObjectMessage) message; UserActionRequest userActionRequest = (UserActionRequest) objectMessage.getObject(); log.debug("found action " + userActionRequest.getActionKey()); taskHandler.handleTask(userActionRequest); } else { log.debug("message received is not of ObjectMessage type."); } } catch (Exception e) { log.error(e); } }
AsyncActionProcessorMDB implements MessageListener { @Override public void onMessage(final Message message) { try { if (message instanceof ObjectMessage) { log.debug("message received is of ObjectMessage type."); ObjectMessage objectMessage = (ObjectMessage) message; UserActionRequest userActionRequest = (UserActionRequest) objectMessage.getObject(); log.debug("found action " + userActionRequest.getActionKey()); taskHandler.handleTask(userActionRequest); } else { log.debug("message received is not of ObjectMessage type."); } } catch (Exception e) { log.error(e); } } }
AsyncActionProcessorMDB implements MessageListener { @Override public void onMessage(final Message message) { try { if (message instanceof ObjectMessage) { log.debug("message received is of ObjectMessage type."); ObjectMessage objectMessage = (ObjectMessage) message; UserActionRequest userActionRequest = (UserActionRequest) objectMessage.getObject(); log.debug("found action " + userActionRequest.getActionKey()); taskHandler.handleTask(userActionRequest); } else { log.debug("message received is not of ObjectMessage type."); } } catch (Exception e) { log.error(e); } } AsyncActionProcessorMDB(final TaskHandler inTaskHandler); }
AsyncActionProcessorMDB implements MessageListener { @Override public void onMessage(final Message message) { try { if (message instanceof ObjectMessage) { log.debug("message received is of ObjectMessage type."); ObjectMessage objectMessage = (ObjectMessage) message; UserActionRequest userActionRequest = (UserActionRequest) objectMessage.getObject(); log.debug("found action " + userActionRequest.getActionKey()); taskHandler.handleTask(userActionRequest); } else { log.debug("message received is not of ObjectMessage type."); } } catch (Exception e) { log.error(e); } } AsyncActionProcessorMDB(final TaskHandler inTaskHandler); @Override void onMessage(final Message message); }
AsyncActionProcessorMDB implements MessageListener { @Override public void onMessage(final Message message) { try { if (message instanceof ObjectMessage) { log.debug("message received is of ObjectMessage type."); ObjectMessage objectMessage = (ObjectMessage) message; UserActionRequest userActionRequest = (UserActionRequest) objectMessage.getObject(); log.debug("found action " + userActionRequest.getActionKey()); taskHandler.handleTask(userActionRequest); } else { log.debug("message received is not of ObjectMessage type."); } } catch (Exception e) { log.error(e); } } AsyncActionProcessorMDB(final TaskHandler inTaskHandler); @Override void onMessage(final Message message);  }