public void onMessage(Message message) {
try {
HashMap props = (HashMap) ((ObjectMessage) message).getObject();
messageCreator.sendMessage(props);
} catch (MailAuthenticationException e) {
throw new EmailException(e);
} catch (MailPreparationException e) {
throw new EmailException(e);
} catch (MailParseException e) {
throw new EmailException(e);
} catch (MailSendException e) {
/*
* TODO find the specific exception that results from the smtp
* server being down, and throw this as an EmailException.
* Otherwise, log and then swallow this exception, as it may have
* been possible that this email was actually sent.
*/
throw new EmailException(e);
} catch (JMSException e) {
throw new EmailException(e);
}
}