]> git.mxchange.org Git - jcoreee.git/blobdiff - src/org/mxchange/jcoreee/bean/ejb/BaseEnterpriseBean.java
Continued:
[jcoreee.git] / src / org / mxchange / jcoreee / bean / ejb / BaseEnterpriseBean.java
index a0534434abcf7aa2d48d09cb4a5f354991afd77c..e0d6755864241c23f534942865fabe0c6281f685 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 - 2020 Free Software Foundation
+ * Copyright (C) 2016 - 2022 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
@@ -95,9 +95,24 @@ public abstract class BaseEnterpriseBean implements Serializable {
         * @param queueJndi   JNDI name for email queue
         */
        protected BaseEnterpriseBean (final String factoryJndi, final String queueJndi) {
-               // Call default constructor
+               // Invoke default constructor
                this();
 
+               // Validate all parameter
+               if (null == factoryJndi) {
+                       // Throw IAE
+                       throw new NullPointerException("factoryJndi is null"); //NOI18N
+               } else if (factoryJndi.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("factoryJndi is empty"); //NOI18N
+               } else if (null == queueJndi) {
+                       // Throw IAE
+                       throw new NullPointerException("queueJndi is null"); //NOI18N
+               } else if (queueJndi.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("queueJndi is empty"); //NOI18N
+               }
+
                // Try it out
                try {
                        // Get initial context