From: Roland Häder Date: Wed, 18 May 2016 07:34:11 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=96867d4f77205d6dd056d41deb8e7cd0a8d56a00;p=jcore-utils.git Continued a bit: - added trace messages - added check on parameter for null --- diff --git a/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java b/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java index 302daeb..942f30f 100644 --- a/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java +++ b/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java @@ -96,14 +96,23 @@ public abstract class BaseDatabaseBean implements Serializable { * @throws JMSException if something went wrong */ protected void sendMessage (final ObjectMessage message, final MessageProducer messageProducer) throws JMSException { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendMessage: message={0},messageProducer={1} - CALLED!", message, messageProducer)); //NOI18N + // The parameter should be valid if (null == message) { // Throw NPE throw new NullPointerException("message is null"); //NOI18N + } else if (null == messageProducer) { + // Throw NPE again + throw new NullPointerException("messageProvider is null"); //NOI18N } // Send it messageProducer.send(message); + + // Trace message + this.getLoggerBeanLocal().logTrace("sendMessage: EXIT!"); //NOI18N } }