From 320ffad1e78f6b86c571dee8c06ffd91def75c48 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 1 Apr 2016 20:21:15 +0200 Subject: [PATCH] renamed Mailer to BaseMailer and made it abstract, all methods here should be generic enough then. --- nbproject/project.properties | 4 ++-- .../delivery/{Mailer.java => BaseMailer.java} | 17 +++++++++++++---- .../model/delivery/DeliverableEmail.java | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) rename src/org/mxchange/jmailee/model/delivery/{Mailer.java => BaseMailer.java} (89%) diff --git a/nbproject/project.properties b/nbproject/project.properties index 5e0c317..ca819ac 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -49,8 +49,8 @@ javac.deprecation=true javac.external.vm=true javac.processorpath=\ ${javac.classpath} -javac.source=1.8 -javac.target=1.8 +javac.source=1.7 +javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/src/org/mxchange/jmailee/model/delivery/Mailer.java b/src/org/mxchange/jmailee/model/delivery/BaseMailer.java similarity index 89% rename from src/org/mxchange/jmailee/model/delivery/Mailer.java rename to src/org/mxchange/jmailee/model/delivery/BaseMailer.java index 5af60a2..197daa7 100644 --- a/src/org/mxchange/jmailee/model/delivery/Mailer.java +++ b/src/org/mxchange/jmailee/model/delivery/BaseMailer.java @@ -38,7 +38,7 @@ import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; *

* @author Roland Haeder */ -public class Mailer implements DeliverableEmail { +public abstract class BaseMailer implements DeliverableEmail { /** * Serial number @@ -60,7 +60,7 @@ public class Mailer implements DeliverableEmail { /** * Default constructor */ - public Mailer () { + protected BaseMailer () { try { // Get initial context Context context = new InitialContext(); @@ -76,7 +76,7 @@ public class Mailer implements DeliverableEmail { @Override public void sendEmailChangeMail (final MessageProducer messageProducer, final ObjectMessage message, final ChangeableEmailAddress emailChange) { // Trace message - this.loggerBeanLocal.logTrace(MessageFormat.format("messageProducer={0},message={1},emailChange={2} - CALLED", messageProducer, message, emailChange)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmailChangeMail: messageProducer={0},message={1},emailChange={2} - CALLED", messageProducer, message, emailChange)); //NOI18N // All parameters + some sub objects must be set if (null == messageProducer) { @@ -114,6 +114,15 @@ public class Mailer implements DeliverableEmail { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + /** + * Getter for logger bean + *

+ * @return Local logger bean + */ + protected LoggerBeanLocal getLoggerBeanLocal () { + return this.loggerBeanLocal; + } + /** * Sends an email to given email address with subject line. *

@@ -124,7 +133,7 @@ public class Mailer implements DeliverableEmail { * @throws NamingException If the resource cannot be found * @throws MessagingException If something happened on message delivery */ - private void sendMail (final String emailAddress, final String subjectLine, final String body) throws NamingException, MessagingException { + protected void sendMail (final String emailAddress, final String subjectLine, final String body) throws NamingException, MessagingException { // Get MIME message instance MimeMessage message = new MimeMessage(this.jmailjjobs); diff --git a/src/org/mxchange/jmailee/model/delivery/DeliverableEmail.java b/src/org/mxchange/jmailee/model/delivery/DeliverableEmail.java index 7bd3f1e..8d6535b 100644 --- a/src/org/mxchange/jmailee/model/delivery/DeliverableEmail.java +++ b/src/org/mxchange/jmailee/model/delivery/DeliverableEmail.java @@ -29,7 +29,7 @@ import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; public interface DeliverableEmail extends Serializable { /** - * Sends out an email-change mail to the attacher user's email address + * Sends out an email-change mail to the attached user's email address *

* @param messageProducer Message product * @param message Message object -- 2.39.5