From 96867d4f77205d6dd056d41deb8e7cd0a8d56a00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 18 May 2016 09:34:11 +0200 Subject: [PATCH] Continued a bit: - added trace messages - added check on parameter for null --- src/org/mxchange/jcoreee/database/BaseDatabaseBean.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 } } -- 2.39.5