[jboss-svn-commits] JBL Code SVN: r5504 - in labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb: helpers notification

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Aug 6 04:19:14 EDT 2006


Author: arvinder
Date: 2006-08-06 04:19:09 -0400 (Sun, 06 Aug 2006)
New Revision: 5504

Added:
   labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/Email.java
Removed:
   labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java
Modified:
   labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/notification/NotifyEmail.java
Log:
renamed EsbEmail to Email

Copied: labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/Email.java (from rev 5501, labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java)
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java	2006-08-05 22:39:51 UTC (rev 5501)
+++ labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/Email.java	2006-08-06 08:19:09 UTC (rev 5504)
@@ -0,0 +1,283 @@
+/*
+ * 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.soa.esb.helpers;
+
+import java.util.Properties;
+
+import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
+import javax.mail.Address;
+import javax.mail.Authenticator;
+import javax.mail.BodyPart;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.jboss.soa.esb.common.SystemProperties;
+
+/**
+ * Simplifies sending of e-mails with attachments from java.
+ * <p/>
+ * The message is sent via a subsequent call to the {@link #sendMessage()}
+ * method.
+ * 
+ * <h3 id="p_oMessageParms">Message Parmeters</h3>
+ * The class constructor is supplied the following parameters via a
+ * {@link org.jboss.soa.esb.helpers.DomElement} instance:
+ * <ol>
+ * 	<li><b>FROM</b>: valid e-mail address</li>
+ * 	<li><b>SENDTO</b>: valid comma separated list of e-mail addresses</li>
+ * 	<li><b>SUBJECT</b>: free text that will appear as subject of the e-mail</li>
+ * 	<li><b>MESSAGE</b>: free text that will appear as contents of the e-mail</li>
+ * 	<li><b>ATTACH</b>: list (as Text children) of valid accessible filenames to
+ * 			attach to the e-mail</li>
+ * </ol>
+ * All parameters except 'ATTACH' are attributes of the DomElement argument. ATTACH
+ * parameters (attachments) are added as child DomElements of the  supplied
+ * DomElement.
+ * 
+ * @author: Heuristica - Buenos Aires - Argentina
+ */
+public class Email {
+	/**
+	 * DomElement attribute : will be the contents of the From: field in the
+	 * outgoing message
+	 */
+	public static final String FROM = "from";
+
+	/**
+	 * DomElement attribute : comma separated list of recipients
+	 */
+	public static final String SENDTO = "sendTo";
+
+	/**
+	 * DomElement attribute : comma separated list of Copy recipients
+	 */
+	public static final String COPYTO = "ccTo";
+
+	/**
+	 * DomElement attribute : will be the contents of the Subject: field in the
+	 * outgoing message
+	 */
+	public static final String SUBJECT = "subject";
+
+	/**
+	 * DomElement attribute : Value of this attribute will be the content of the
+	 * e-mail's text
+	 */
+	public static final String ATTACH = "attachment";
+
+	/**
+	 * DomElement child Text elements : Each child represents the name of a file
+	 * to be attached in the outgoing message
+	 */
+	public static final String MESSAGE = "message";
+
+	/**
+	 * The message to b sent via a subsequent call to {@link #sendMessage()}.
+	 */
+	private MimeMessage mailMessage;
+
+	/**
+	 * Public constructor.
+	 * <p/>
+	 * Initialises the mail server session and creates the mail message using 
+	 * the information provided in the p_oMessageParms 
+	 * <a href="p_oMessageParms">listed above</a>.
+	 * <p/>
+	 * The message is sent via a subsequent call to the {@link #sendMessage()}
+	 * method.
+	 * 
+	 * @param p_oMessageParms
+	 *            A DomElement object containing the elements mentioned above
+	 * @throws MessagingException 
+	 * @throws AddressException 
+	 * @see DomElement
+	 * 
+	 */
+	public Email(DomElement p_oMessageParms) throws AddressException, MessagingException {
+		// REVIEW: How about typing the parameters a little better??? Looks as though that might have a huge ripple-on effect accross the codebase!!
+		// REVIEW: Does the session need to ne initialised every time???
+		Session oMailSess = initMailServerSession();
+		
+		// Initialise the oMailMess property... 
+		mailMessage = createMailMessage(p_oMessageParms, oMailSess);
+		
+		// Message can be "sent" via a subsequent call to the sendMessage method!
+	} // __________________________________
+
+	/**
+	 * Send the mail message associated with this instance.
+	 * @throws MessagingException Unable to transport the message associated with this
+	 * EsbEmail instance.
+	 */
+	public void sendMessage() throws MessagingException {
+		Transport.send(mailMessage);
+	}
+	
+	/**
+	 * Get the {@link MimeMessage mail message} associated with this EsbMail
+	 * instance.
+	 * @return The mailMessage property value.
+	 */
+	public MimeMessage getMailMessage() {
+		return mailMessage;
+	}
+
+	/**
+	 * Create the mail message instance to be {@link #sendMessage() sent}.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMailSess Mail session on which the message is to be transported.
+	 * @return The message.
+	 * @throws AddressException
+	 * @throws MessagingException
+	 */
+	private MimeMessage createMailMessage(DomElement p_oMessageParms, Session oMailSess) throws AddressException, MessagingException {
+		MimeMessage oMessage = new MimeMessage(oMailSess);
+		
+		// Populate the message with the data supplied in the p_oMessageParms DomElement.
+		addMessageAddressing(p_oMessageParms, oMessage);
+		addMessageSubject(p_oMessageParms, oMessage);
+		addMessageContent(p_oMessageParms, oMessage);
+		
+		return oMessage;
+	}
+
+	/**
+	 * Add the message addressing information to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws AddressException
+	 * @throws MessagingException
+	 */
+	private void addMessageAddressing(DomElement p_oMessageParms, MimeMessage oMessage) throws AddressException, MessagingException {
+		String sFrom = p_oMessageParms.getAttr(FROM);
+		InternetAddress oFrom = new InternetAddress(sFrom);
+	
+		oMessage.setFrom(oFrom);
+		oMessage.setReplyTo(new Address[] { oFrom });
+		InternetAddress[] oaTo = 
+			InternetAddress.parse(p_oMessageParms.getAttr(SENDTO));
+		
+		for (int i1 = 0; i1 < oaTo.length; i1++) {
+			oMessage.addRecipient(MimeMessage.RecipientType.TO, oaTo[i1]);
+		}
+	
+		String sCopyToAddress = (String) p_oMessageParms.getAttr(COPYTO);
+		if (null != sCopyToAddress) {
+			oaTo = InternetAddress.parse(sCopyToAddress);
+			for (int i1 = 0; i1 < oaTo.length; i1++) {
+				oMessage.addRecipient(MimeMessage.RecipientType.CC, oaTo[i1]);
+			}
+		}
+	}
+
+	/**
+	 * Add the message Subject to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws MessagingException
+	 */
+	private void addMessageSubject(DomElement p_oMessageParms, MimeMessage oMessage) throws MessagingException {
+		String sSubject = (String) p_oMessageParms.getAttr(SUBJECT);
+
+		if (null != sSubject) {
+			oMessage.setSubject(sSubject);
+		}
+	}
+
+	/**
+	 * Add the message content (body, attachments etc) to from the
+	 * message parameters to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws MessagingException
+	 */
+	private void addMessageContent(DomElement p_oMessageParms, MimeMessage oMessage) throws MessagingException {
+		BodyPart oBodyP = new MimeBodyPart();
+		Multipart oMultiP = new MimeMultipart();
+
+		oMultiP.addBodyPart(oBodyP);
+		oMessage.setContent(oMultiP);
+		String sBodyPartText = p_oMessageParms.getAttr(MESSAGE);
+		if (null == sBodyPartText) {
+			sBodyPartText = "";
+		}
+		oBodyP.setText(sBodyPartText + "\n");
+
+		String[] saFn = p_oMessageParms.getTextChildren(ATTACH);
+		for (int i1 = 0; i1 < saFn.length; i1++) {
+			oMultiP.addBodyPart(oBodyP = new MimeBodyPart());
+			String sFile = saFn[i1];
+			oBodyP.setDataHandler(new DataHandler(new FileDataSource(sFile)));
+			oBodyP.setFileName(sFile.substring(1 + sFile.lastIndexOf("\\")));
+		}
+	}
+
+	/**
+	 * Initialise an authenticated {@link javax.mail.Session} with the mail server.
+	 * @return The {@link javax.mail.Session}. 
+	 */
+	private Session initMailServerSession() {
+		Authenticator oAuth = null;
+		String sSmtpUser = SystemProperties.getSmtpUsername();
+		
+		if (null != sSmtpUser) {
+			oAuth = new MyAuth(sSmtpUser, SystemProperties.getSmtpPassword());
+		}
+
+		Properties oMailP = new Properties();
+		oMailP.setProperty("mail.smtp.host", SystemProperties.getSmtpHost());
+		try {
+			String sPort = SystemProperties.getSmtpPort();
+			Integer.parseInt(sPort);
+			oMailP.setProperty("mail.smtp.port", sPort);
+		} catch (Exception e) { /* OK just leave standard port */
+		}
+		javax.mail.Session oMailSess = 
+			javax.mail.Session.getDefaultInstance(oMailP, oAuth);
+		return oMailSess;
+	}
+
+	private class MyAuth extends Authenticator {
+		private String m_sUser, m_sPwd;
+
+		private MyAuth(String p_sU, String p_sP) {
+			m_sUser = p_sU;
+			m_sPwd = p_sP;
+		}
+
+		protected PasswordAuthentication getPasswordAuthentication() {
+			return new PasswordAuthentication(m_sUser, m_sPwd);
+		} // ________________________________
+	} // ______________________________________________________
+
+} // ____________________________________________________________________________
+

Deleted: labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java	2006-08-06 03:01:30 UTC (rev 5503)
+++ labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/helpers/EsbEmail.java	2006-08-06 08:19:09 UTC (rev 5504)
@@ -1,283 +0,0 @@
-/*
- * 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.soa.esb.helpers;
-
-import java.util.Properties;
-
-import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
-import javax.mail.Address;
-import javax.mail.Authenticator;
-import javax.mail.BodyPart;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import org.jboss.soa.esb.common.SystemProperties;
-
-/**
- * Simplifies sending of e-mails with attachments from java.
- * <p/>
- * The message is sent via a subsequent call to the {@link #sendMessage()}
- * method.
- * 
- * <h3 id="p_oMessageParms">Message Parmeters</h3>
- * The class constructor is supplied the following parameters via a
- * {@link org.jboss.soa.esb.helpers.DomElement} instance:
- * <ol>
- * 	<li><b>FROM</b>: valid e-mail address</li>
- * 	<li><b>SENDTO</b>: valid comma separated list of e-mail addresses</li>
- * 	<li><b>SUBJECT</b>: free text that will appear as subject of the e-mail</li>
- * 	<li><b>MESSAGE</b>: free text that will appear as contents of the e-mail</li>
- * 	<li><b>ATTACH</b>: list (as Text children) of valid accessible filenames to
- * 			attach to the e-mail</li>
- * </ol>
- * All parameters except 'ATTACH' are attributes of the DomElement argument. ATTACH
- * parameters (attachments) are added as child DomElements of the  supplied
- * DomElement.
- * 
- * @author: Heuristica - Buenos Aires - Argentina
- */
-public class EsbEmail {
-	/**
-	 * DomElement attribute : will be the contents of the From: field in the
-	 * outgoing message
-	 */
-	public static final String FROM = "from";
-
-	/**
-	 * DomElement attribute : comma separated list of recipients
-	 */
-	public static final String SENDTO = "sendTo";
-
-	/**
-	 * DomElement attribute : comma separated list of Copy recipients
-	 */
-	public static final String COPYTO = "ccTo";
-
-	/**
-	 * DomElement attribute : will be the contents of the Subject: field in the
-	 * outgoing message
-	 */
-	public static final String SUBJECT = "subject";
-
-	/**
-	 * DomElement attribute : Value of this attribute will be the content of the
-	 * e-mail's text
-	 */
-	public static final String ATTACH = "attachment";
-
-	/**
-	 * DomElement child Text elements : Each child represents the name of a file
-	 * to be attached in the outgoing message
-	 */
-	public static final String MESSAGE = "message";
-
-	/**
-	 * The message to b sent via a subsequent call to {@link #sendMessage()}.
-	 */
-	private MimeMessage mailMessage;
-
-	/**
-	 * Public constructor.
-	 * <p/>
-	 * Initialises the mail server session and creates the mail message using 
-	 * the information provided in the p_oMessageParms 
-	 * <a href="p_oMessageParms">listed above</a>.
-	 * <p/>
-	 * The message is sent via a subsequent call to the {@link #sendMessage()}
-	 * method.
-	 * 
-	 * @param p_oMessageParms
-	 *            A DomElement object containing the elements mentioned above
-	 * @throws MessagingException 
-	 * @throws AddressException 
-	 * @see DomElement
-	 * 
-	 */
-	public EsbEmail(DomElement p_oMessageParms) throws AddressException, MessagingException {
-		// REVIEW: How about typing the parameters a little better??? Looks as though that might have a huge ripple-on effect accross the codebase!!
-		// REVIEW: Does the session need to ne initialised every time???
-		Session oMailSess = initMailServerSession();
-		
-		// Initialise the oMailMess property... 
-		mailMessage = createMailMessage(p_oMessageParms, oMailSess);
-		
-		// Message can be "sent" via a subsequent call to the sendMessage method!
-	} // __________________________________
-
-	/**
-	 * Send the mail message associated with this instance.
-	 * @throws MessagingException Unable to transport the message associated with this
-	 * EsbEmail instance.
-	 */
-	public void sendMessage() throws MessagingException {
-		Transport.send(mailMessage);
-	}
-	
-	/**
-	 * Get the {@link MimeMessage mail message} associated with this EsbMail
-	 * instance.
-	 * @return The mailMessage property value.
-	 */
-	public MimeMessage getMailMessage() {
-		return mailMessage;
-	}
-
-	/**
-	 * Create the mail message instance to be {@link #sendMessage() sent}.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMailSess Mail session on which the message is to be transported.
-	 * @return The message.
-	 * @throws AddressException
-	 * @throws MessagingException
-	 */
-	private MimeMessage createMailMessage(DomElement p_oMessageParms, Session oMailSess) throws AddressException, MessagingException {
-		MimeMessage oMessage = new MimeMessage(oMailSess);
-		
-		// Populate the message with the data supplied in the p_oMessageParms DomElement.
-		addMessageAddressing(p_oMessageParms, oMessage);
-		addMessageSubject(p_oMessageParms, oMessage);
-		addMessageContent(p_oMessageParms, oMessage);
-		
-		return oMessage;
-	}
-
-	/**
-	 * Add the message addressing information to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws AddressException
-	 * @throws MessagingException
-	 */
-	private void addMessageAddressing(DomElement p_oMessageParms, MimeMessage oMessage) throws AddressException, MessagingException {
-		String sFrom = p_oMessageParms.getAttr(FROM);
-		InternetAddress oFrom = new InternetAddress(sFrom);
-	
-		oMessage.setFrom(oFrom);
-		oMessage.setReplyTo(new Address[] { oFrom });
-		InternetAddress[] oaTo = 
-			InternetAddress.parse(p_oMessageParms.getAttr(SENDTO));
-		
-		for (int i1 = 0; i1 < oaTo.length; i1++) {
-			oMessage.addRecipient(MimeMessage.RecipientType.TO, oaTo[i1]);
-		}
-	
-		String sCopyToAddress = (String) p_oMessageParms.getAttr(COPYTO);
-		if (null != sCopyToAddress) {
-			oaTo = InternetAddress.parse(sCopyToAddress);
-			for (int i1 = 0; i1 < oaTo.length; i1++) {
-				oMessage.addRecipient(MimeMessage.RecipientType.CC, oaTo[i1]);
-			}
-		}
-	}
-
-	/**
-	 * Add the message Subject to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws MessagingException
-	 */
-	private void addMessageSubject(DomElement p_oMessageParms, MimeMessage oMessage) throws MessagingException {
-		String sSubject = (String) p_oMessageParms.getAttr(SUBJECT);
-
-		if (null != sSubject) {
-			oMessage.setSubject(sSubject);
-		}
-	}
-
-	/**
-	 * Add the message content (body, attachments etc) to from the
-	 * message parameters to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws MessagingException
-	 */
-	private void addMessageContent(DomElement p_oMessageParms, MimeMessage oMessage) throws MessagingException {
-		BodyPart oBodyP = new MimeBodyPart();
-		Multipart oMultiP = new MimeMultipart();
-
-		oMultiP.addBodyPart(oBodyP);
-		oMessage.setContent(oMultiP);
-		String sBodyPartText = p_oMessageParms.getAttr(MESSAGE);
-		if (null == sBodyPartText) {
-			sBodyPartText = "";
-		}
-		oBodyP.setText(sBodyPartText + "\n");
-
-		String[] saFn = p_oMessageParms.getTextChildren(ATTACH);
-		for (int i1 = 0; i1 < saFn.length; i1++) {
-			oMultiP.addBodyPart(oBodyP = new MimeBodyPart());
-			String sFile = saFn[i1];
-			oBodyP.setDataHandler(new DataHandler(new FileDataSource(sFile)));
-			oBodyP.setFileName(sFile.substring(1 + sFile.lastIndexOf("\\")));
-		}
-	}
-
-	/**
-	 * Initialise an authenticated {@link javax.mail.Session} with the mail server.
-	 * @return The {@link javax.mail.Session}. 
-	 */
-	private Session initMailServerSession() {
-		Authenticator oAuth = null;
-		String sSmtpUser = SystemProperties.getSmtpUsername();
-		
-		if (null != sSmtpUser) {
-			oAuth = new MyAuth(sSmtpUser, SystemProperties.getSmtpPassword());
-		}
-
-		Properties oMailP = new Properties();
-		oMailP.setProperty("mail.smtp.host", SystemProperties.getSmtpHost());
-		try {
-			String sPort = SystemProperties.getSmtpPort();
-			Integer.parseInt(sPort);
-			oMailP.setProperty("mail.smtp.port", sPort);
-		} catch (Exception e) { /* OK just leave standard port */
-		}
-		javax.mail.Session oMailSess = 
-			javax.mail.Session.getDefaultInstance(oMailP, oAuth);
-		return oMailSess;
-	}
-
-	private class MyAuth extends Authenticator {
-		private String m_sUser, m_sPwd;
-
-		private MyAuth(String p_sU, String p_sP) {
-			m_sUser = p_sU;
-			m_sPwd = p_sP;
-		}
-
-		protected PasswordAuthentication getPasswordAuthentication() {
-			return new PasswordAuthentication(m_sUser, m_sPwd);
-		} // ________________________________
-	} // ______________________________________________________
-
-} // ____________________________________________________________________________
-

Modified: labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/notification/NotifyEmail.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/notification/NotifyEmail.java	2006-08-06 03:01:30 UTC (rev 5503)
+++ labs/jbossesb/branches/refactor/product/core/common/src/org/jboss/soa/esb/notification/NotifyEmail.java	2006-08-06 08:19:09 UTC (rev 5504)
@@ -51,19 +51,19 @@
 	 *            EsbEmail(DomElement) constructor - The MESSAGE attribute will
 	 *            be filled in at sendNotification(Serializable) time
 	 * @throws Exception
-	 * @see EsbEmail#EsbEmail(DomElement)
+	 * @see Email#Email(DomElement)
 	 * @see NotifyEmail#sendNotification(Serializable)
 	 */
 	public NotifyEmail(DomElement p_oP) throws Exception {
 		super(p_oP);
 
-		String sAtt = (String) m_oParms.getAttr(EsbEmail.FROM);
+		String sAtt = (String) m_oParms.getAttr(Email.FROM);
 		if (null != sAtt)
 			InternetAddress.parse(sAtt);
 
-		InternetAddress.parse(m_oParms.getAttr(EsbEmail.SENDTO));
+		InternetAddress.parse(m_oParms.getAttr(Email.SENDTO));
 
-		sAtt = (String) m_oParms.getAttr(EsbEmail.COPYTO);
+		sAtt = (String) m_oParms.getAttr(Email.COPYTO);
 		if (null != sAtt)
 			InternetAddress.parse(sAtt);
 	} // __________________________________
@@ -79,9 +79,9 @@
 	public void sendNotification(Serializable p_o) {
 		try {
 			DomElement oP = m_oParms.cloneObj();
-			String sMsg = oP.getAttr(EsbEmail.MESSAGE);
+			String sMsg = oP.getAttr(Email.MESSAGE);
 			sMsg = ((null == sMsg) ? p_o.toString() : sMsg + "\n") + p_o.toString();
-			oP.setAttr(EsbEmail.MESSAGE, sMsg);
+			oP.setAttr(Email.MESSAGE, sMsg);
 			sendEmailNotification(oP);
 		} catch (Exception e) {
 			EsbUtil.getDefaultLogger(this.getClass()).error("Send Mail Failed",
@@ -97,7 +97,7 @@
 	 * @param messageParams Message parameters.
 	 */
 	protected void sendEmailNotification(DomElement messageParams) throws AddressException, MessagingException {
-		EsbEmail esbMail = new EsbEmail(messageParams);
+		Email esbMail = new Email(messageParams);
 		esbMail.sendMessage();
 	}
 




More information about the jboss-svn-commits mailing list