[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-cvs-commits
Subject: [jboss-cvs] jboss-mail/src/java/org/jboss/mail/delivery ...
From: Andy Oliver <acoliver () jboss ! org>
Date: 2006-03-31 22:34:52
Message-ID: E1FPSCi-0007r7-V5 () committer01 ! frg ! pub ! inap ! atl ! jboss ! com
[Download RAW message or body]
User: acoliver
Date: 06/03/31 17:34:52
Modified: src/java/org/jboss/mail/delivery DeliveryMDB.java
Log:
fixed (c) headers, removed no-longer-used files, added missing authors, version \
tags, basic cleanup/tcb, formatting consistant throughout project
Revision Changes Path
1.3 +88 -75 jboss-mail/src/java/org/jboss/mail/delivery/DeliveryMDB.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DeliveryMDB.java
===================================================================
RCS file: /cvsroot/jboss/jboss-mail/src/java/org/jboss/mail/delivery/DeliveryMDB.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- DeliveryMDB.java 31 Mar 2006 21:55:59 -0000 1.2
+++ DeliveryMDB.java 31 Mar 2006 22:34:52 -0000 1.3
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.mail.delivery;
import javax.ejb.EJBException;
@@ -39,35 +39,45 @@
import org.jboss.mail.util.JBMailJMXUtil;
/**
- * Do not think this is still used, if so should be converted to message driven \
pojo + * Do not think this is still used, if so should be converted to message \
driven + * pojo
*
* @author Andrew C. Oliver <acoliver ot jboss dat org>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class DeliveryMDB implements MessageDrivenBean, MessageListener {
private static final long serialVersionUID = -7671292897388892674L;
+
private MailListenerChain chain;
+
private static final Logger log = Logger.getLogger(DeliveryMDB.class);
public void ejbCreate() {
try {
InitialContext ctx = new InitialContext();
- ObjectName listenerName = new \
ObjectName((String)ctx.lookup("java:comp/env/MailListenerChain"));
- chain = (MailListenerChain) JBMailJMXUtil.getMBean(listenerName, \
MailListenerChain.class);
- }
- catch (NamingException e) {
- log.error("Failed to lookup name of chain MBean from the Inital \
Context", e);
- throw new RuntimeException("Failed to lookup name of chain MBean from \
the Inital Context", e);
- }
- catch (MalformedObjectNameException e) {
+ ObjectName listenerName = new ObjectName((String) ctx
+ .lookup("java:comp/env/MailListenerChain"));
+ chain = (MailListenerChain) JBMailJMXUtil.getMBean(listenerName,
+ MailListenerChain.class);
+ } catch (NamingException e) {
+ log
+ .error(
+ "Failed to lookup name of chain MBean from the Inital Context",
+ e);
+ throw new RuntimeException(
+ "Failed to lookup name of chain MBean from the Inital Context",
+ e);
+ } catch (MalformedObjectNameException e) {
log.error("The name of the mail listener chain is not correct", e);
- throw new RuntimeException("The name of the mail listener chain is not \
correct", e); + throw new RuntimeException(
+ "The name of the mail listener chain is not correct", e);
}
}
- public void setMessageDrivenContext(MessageDrivenContext arg0) throws \
EJBException { + public void setMessageDrivenContext(MessageDrivenContext arg0)
+ throws EJBException {
// TODO Auto-generated method stub
}
@@ -83,17 +93,20 @@
// Convert the incoming message to a Mail message.
ObjectMessage jmsObjectMessage = (ObjectMessage) jmsMessage;
Object messageObject = jmsObjectMessage.getObject();
- if( !(messageObject instanceof Mail) )
- {
- log.error( "Invalid Object placed in Local Delivery queue. \
Expected type is: " + Mail.class + " but was: " + messageObject.getClass() + "; \
Message will be ignored."); + if (!(messageObject instanceof Mail)) {
+ log
+ .error("Invalid Object placed in Local Delivery queue. Expected type is: "
+ + Mail.class
+ + " but was: "
+ + messageObject.getClass()
+ + "; Message will be ignored.");
return;
}
Mail smtpMessage = (Mail) jmsObjectMessage.getObject();
log.debug("Passing mail to delivery chain");
chain.processMail(smtpMessage);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.error("Failed to process message, message lost.", e);
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic