/*
 * $Id: $
 * $URL:  $
 */

package org.subethamail.core.queue;

import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Inject;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.subethamail.common.NotFoundException;
import org.subethamail.core.deliv.i.Deliverator;

/**
 * Processes delivery queue messages by creating an actual STMP message
 * using JavaMail, relaying it through the {@link Deliverator}.
 */
//@MessageDriven	// declared in resin-web.xml
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class DeliveryListener implements MessageListener
{
	/** */
	private final static Logger log = LoggerFactory.getLogger(DeliveryListener.class);

	/** */
	@Inject Deliverator deliverator;

	/**
	 */
	public void onMessage(Message qMsg)
	{
		try
		{
			DeliveryQueueItem item = (DeliveryQueueItem)((ObjectMessage) qMsg).getObject();

			Long mailId = item.getMailId();
			Long personId = item.getPersonId();

			if (log.isDebugEnabled())
				log.debug("Delivering mailId:" + mailId + " to personId:" + personId);
			
			try
			{
				this.deliverator.deliver(mailId, personId);
			}
			catch (NotFoundException ex)
			{
				// Just log a warning and accept the JMS message
				// It possible the message/subscription has been deleted since we queued the orig request.
				if (log.isWarnEnabled())
					log.warn("Unknown mailId(" + mailId + ") or personId(" + personId + ")", ex);
			}
		}
		catch (JMSException ex)
		{
			if (log.isErrorEnabled())
				log.error("Error getting data out of message.", ex);
			
			throw new RuntimeException(ex);
		}
	}
}

@@ -63,24 +63,96 @@
 e.queue;%0D%0A%0D%0A
+import java.util.logging.Level;%0D%0Aimport java.util.logging.LogRecord;%0D%0A%0D%0A
 import javax
@@ -392,58 +392,33 @@
 ort 
-org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;
+lombok.extern.java.Log;%0D%0A
 %0D%0Aim
@@ -770,16 +770,22 @@
 UIRED)%0D%0A
+@Log%0D%0A
 public c
@@ -841,104 +841,8 @@
 %0A%7B%0D%0A
-%09/** */%0D%0A%09private final static Logger log = LoggerFactory.getLogger(DeliveryListener.class);%0D%0A%0D%0A
 %09/**
@@ -1120,98 +1120,88 @@
 %0A%09%09%09
-if (log.isDebugEnabled())%0D%0A%09%09%09%09log.debug(%22Delivering mailId:%22 + mailId + %22 to personId:%22 +
+log.log(Level.FINE,%22Delivering mailId:%7B0%7D to personId:%7B1%7D%22, new Object%5B%5D%7BmailId,
  per
@@ -1201,24 +1201,25 @@
 Id, personId
+%7D
 );%0D%0A%09%09%09%0D%0A%09%09%09
@@ -1323,20 +1323,32 @@
 %0D%0A%09%09%09%7B%0D%0A
-%09%09%09%09
+                
 // Just 
@@ -1489,118 +1489,252 @@
 t.%0D%0A
-%09%09%09%09if (log.isWarnEnabled())%0D%0A%09%09%09%09%09log.warn(%22Unknown mailId(%22 + mailId + %22) or personId(%22 + personId + %22)%22, ex
+                LogRecord logRecord=new LogRecord(Level.WARNING, %22Unknown mailId(%7B0%7D) or personId(%7B1%7D)%22);%0D%0A                logRecord.setParameters(new Object%5B%5D%7BmailId, personId%7D);%0D%0A                logRecord.setThrown(ex);%0D%0A%09%09%09%09log.log(logRecord
 );%0D%0A
@@ -1783,49 +1783,30 @@
 %0A%09%09%09
-if (log.isErrorEnabled())%0D%0A%09%09%09%09log.error(
+%09log.log(Level.SEVERE,
 %22Err

switch logging framework