/*
- * 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
/**
* A message queue for sending out emails
* <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
*/
@MessageDriven (
name = "jjobsEmail",
@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) {
// 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));
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) {
}
// 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) {
} 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 {
}
// Trace message
- this.getLoggerBeanLocal().logTrace("onMessage - EXIT!"); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage - EXIT!", this.getClass().getSimpleName())); //NOI18N
}
}