if( this.persister == null)
{
throw new TechnicalException("can't save messages, persister not set");
}
WrappedMessage wrappedMessage = null;
try
{
wrappedMessage = new WrappedMessage(account, currentMsg, new Date());
if( notParsed(wrappedMessage))
{
if( LOG.isDebugEnabled())
{
LOG.debug("processing " + wrappedMessage.getMessageId() + ", Subject: "
+ wrappedMessage.getSubject());
}
if( this.filter != null)
{
this.filter.filter(wrappedMessage);
}
this.persister.addMessage(wrappedMessage);
processListeners(wrappedMessage);
}
}
catch( BusinessException ex)
{
// FIXME: do some error handling
LOG.error("can't read message", ex);
}
catch( Exception ex)
{
if( wrappedMessage != null)
{
FATAL.error(ex.getMessage(), ex);
FATAL.fatal("\n" + wrappedMessage.getRawMessage());
}
}
}