]> git.mxchange.org Git - jjobs-ejb.git/blobdiff - src/java/org/mxchange/jmailee/model/delivery/JobsEmailDeliveryMessageBean.java
updated own name and resources
[jjobs-ejb.git] / src / java / org / mxchange / jmailee / model / delivery / JobsEmailDeliveryMessageBean.java
index 48c4ec978991cdc4ad512b6c373e040eababab25..3a6e0178091d7a94fefe32325995271a7c37f909 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -36,7 +36,7 @@ import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
 /**
  * A message queue for sending out emails
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @MessageDriven (
                name = "jjobsEmail",
@@ -76,13 +76,13 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
        @PostConstruct
        public void init () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("init: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.init: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Try to load bundle
                ResourceBundle bundle = ResourceBundle.getBundle(this.configFile);
 
                // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("init: bundle={0}", bundle)); //NOI18N
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.init: bundle={1}", this.getClass().getSimpleName(), bundle)); //NOI18N
 
                // The bunble should be valid
                if (null == bundle) {
@@ -98,7 +98,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                        // Loop through all
                        for (final String key : bundle.keySet()) {
                                // Log debug message
-                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("init: key={0}", key)); //NOI18N
+                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.init: key={1}", this.getClass().getSimpleName(), key)); //NOI18N
 
                                // Get string from bundle and set it in properties
                                properties.put(key, bundle.getString(key));
@@ -109,13 +109,13 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                this.mailer.init(properties);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("init: EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.init: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
        @Override
        public void onMessage (final Message message) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("onMessage: message={0} - CALLED!", message)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage: message={1} - CALLED!", this.getClass().getSimpleName(), message)); //NOI18N
 
                // The parameter should be valid
                if (null == message) {
@@ -142,7 +142,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                }
 
                // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("onMessage: serializable={0}", serializable)); //NOI18N
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.onMessage: serializable={1}", this.getClass().getSimpleName(), serializable)); //NOI18N
 
                // Okay, is it the right interface?
                if (null == serializable) {
@@ -175,6 +175,9 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                } else if (wrapper.getTemplateName().isEmpty()) {
                        // Is empty
                        throw new IllegalArgumentException("wrapper.templateName is empty"); //NOI18N
+               } else if (wrapper.getTemplateVariables() == null) {
+                       // No template variables set, should not happen
+                       throw new NullPointerException("wrapper.templateVariables is null"); //NOI18N
                }
 
                try {
@@ -187,7 +190,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("onMessage - EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage - EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }