]> git.mxchange.org Git - pizzaservice-mailer-ejb.git/blobdiff - src/java/org/mxchange/pizzaapplication/model/mailer/PizzaMailerSingletonBean.java
Updated copyright year
[pizzaservice-mailer-ejb.git] / src / java / org / mxchange / pizzaapplication / model / mailer / PizzaMailerSingletonBean.java
index f59f125519193457aed15554b3d8abc1cea4852e..660eb13e20ca7df569fc0f72194a7ff86b25ee4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@ import javax.mail.MessagingException;
 import javax.mail.Session;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
+import org.apache.velocity.context.Context;
 import org.mxchange.jmailee.model.delivery.BaseMailerBean;
 import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
 
@@ -36,7 +37,7 @@ import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Singleton (name = "mailerBean", description = "A singleton mailer bean, usually called by jfinancialsEmailDelivery queue bean.")
-public class PizzaMailerSingletonBean extends BaseMailerBean implements DeliverablePizzaEmailLocal {
+public class PizzaMailerSingletonBean extends BaseMailerBean implements DeliverablePizzaEmailRemote {
 
        /**
         * Serial number
@@ -46,7 +47,7 @@ public class PizzaMailerSingletonBean extends BaseMailerBean implements Delivera
        /**
         * Configuration file
         */
-       private final String configFile = "org.mxchange.jmailer.config"; //NOI18N//NOI18N
+       private final String configFile = "org.mxchange.jmailer.config"; //NOI18N
 
        /**
         * Email session
@@ -56,9 +57,10 @@ public class PizzaMailerSingletonBean extends BaseMailerBean implements Delivera
 
        /**
         * Default constructor
-        * <p>
         */
        public PizzaMailerSingletonBean () {
+               // Invoke super constructor
+               super();
        }
 
        /**
@@ -70,7 +72,7 @@ public class PizzaMailerSingletonBean extends BaseMailerBean implements Delivera
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.init: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Try to load bundle
-               ResourceBundle bundle = ResourceBundle.getBundle(this.configFile);
+               final ResourceBundle bundle = ResourceBundle.getBundle(this.configFile);
 
                // Debug message
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.init: bundle={1}", this.getClass().getSimpleName(), bundle)); //NOI18N
@@ -82,7 +84,7 @@ public class PizzaMailerSingletonBean extends BaseMailerBean implements Delivera
                }
 
                // Init Properties
-               Properties properties = new Properties();
+               final Properties properties = new Properties();
 
                // Is the bundle not empty?
                if (!bundle.keySet().isEmpty()) {
@@ -136,10 +138,10 @@ public class PizzaMailerSingletonBean extends BaseMailerBean implements Delivera
                }
 
                // All required data is set, load template
-               Template template = this.getTemplateEngine().getTemplate(String.format("templates/%s/%s.vm", emailWrapper.getLocale().getLanguage().toLowerCase(), emailWrapper.getTemplateName())); //NOI18N
+               final Template template = this.getTemplateEngine().getTemplate(String.format("templates/%s/%s.vm", emailWrapper.getLocale().getLanguage().toLowerCase(), emailWrapper.getTemplateName())); //NOI18N
 
                // Init context
-               VelocityContext context = new VelocityContext();
+               final Context context = new VelocityContext();
 
                // Are some variables set?
                if ((emailWrapper.getTemplateVariables() != null) && (!emailWrapper.getTemplateVariables().isEmpty())) {