]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 3 Sep 2017 01:31:36 +0000 (03:31 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 9 Sep 2017 20:03:54 +0000 (22:03 +0200)
- no more fully container-independency in favour of caching
- removed gf-client (no more Glassfish for already a long time)
- used `@NamedCache` (Payara-specific) for annotating fields, very nice, should
  become generic one day

Signed-off-by: Roland Häder <roland@mxchange.org>
17 files changed:
lib/gf-client.jar [deleted file]
lib/nblibraries.properties
lib/payara-api/payara-api.jar [new file with mode: 0644]
nbproject/project.properties
nbproject/project.xml
src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebRequestBean.java
src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebRequestBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/activity/AddressbookUserActivityWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebRequestBean.java

diff --git a/lib/gf-client.jar b/lib/gf-client.jar
deleted file mode 100644 (file)
index 2f369f3..0000000
Binary files a/lib/gf-client.jar and /dev/null differ
index 847addc64e364a8c99b735cbff0f1a610f88e157..db384dcd6ed14e7742c1be9817ba6d84c890117e 100644 (file)
@@ -13,11 +13,9 @@ libs.CopyLibs.classpath=\
     ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
 libs.CopyLibs.displayName=CopyLibs Task
 libs.CopyLibs.prop-version=2.0
-libs.JCache_CDI.classpath=\
-    ${base}/JCache_CDI/jcache-cdi-0.1-SNAPSHOT.jar
-libs.JCache_CDI.displayName=JCache CDI
-libs.JCache_CDI.src=\
-    ${base}/JCache_CDI/jcache-cdi-0.1-SNAPSHOT-sources.jar!//
+libs.payara-api.classpath=\
+    ${base}/payara-api/payara-api.jar
+libs.payara-api.displayName=Payara API
 libs.primefaces.classpath=\
     ${base}/primefaces/primefaces-6.0.jar
 libs.primefaces.displayName=PrimeFaces 6.0
diff --git a/lib/payara-api/payara-api.jar b/lib/payara-api/payara-api.jar
new file mode 100644 (file)
index 0000000..02de279
Binary files /dev/null and b/lib/payara-api/payara-api.jar differ
index 7102b0c8c858e7e12d0c867b9effc896960fcd31..5e2b7471c14f0d5b26a8a2db8dd55a7cae5fef0a 100644 (file)
@@ -36,7 +36,6 @@ dist.war=${dist.dir}/${war.name}
 endorsed.classpath=
 excludes=
 file.reference.cdi-api.jar=lib/cdi-api.jar
-file.reference.gf-client.jar=lib/gf-client.jar
 file.reference.jaddressbook-core.jar=lib/jaddressbook-core.jar
 file.reference.jaddressbook-lib.jar=lib/jaddressbook-lib.jar
 file.reference.jaddressbook-share-core.jar=lib/jaddressbook-share-core.jar
@@ -94,10 +93,10 @@ javac.classpath=\
     ${reference.addressbook-core.jar}:\
     ${reference.addressbook-lib.jar}:\
     ${file.reference.cdi-api.jar}:\
-    ${file.reference.gf-client.jar}:\
     ${libs.apache_poi.classpath}:\
     ${libs.primefaces.classpath}:\
-    ${libs.cache.classpath}
+    ${libs.cache.classpath}:\
+    ${libs.payara-api.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
 javac.debug=true
index ccd9087bb8ed3c7d01b68cbe10550c0317b9da74..dbe35262c913f082ebf2808a1ca153b6164352e0 100644 (file)
@@ -75,9 +75,6 @@
                 <library dirs="200">
                     <file>${file.reference.cdi-api.jar}</file>
                 </library>
-                <library dirs="200">
-                    <file>${file.reference.gf-client.jar}</file>
-                </library>
                 <library dirs="200">
                     <file>${libs.apache_poi.classpath}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
@@ -88,6 +85,9 @@
                 <library dirs="200">
                     <file>${libs.cache.classpath}</file>
                 </library>
+                <library dirs="200">
+                    <file>${libs.payara-api.classpath}</file>
+                </library>
             </web-module-libraries>
             <web-module-additional-libraries/>
             <source-roots>
index 47c6a2182a38e33c706ab6c2bd2485fbcf542aa2..51a65f58373eb99178798cf948ff01619b00d229 100644 (file)
  */
 package org.mxchange.addressbook.beans.business.basicdata;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
@@ -58,7 +60,7 @@ public class AddressbookBusinessDataWebRequestBean extends BaseAddressbookContro
         * A list of all registered companies (globally)
         */
        @Inject
-       @Cached (cacheName = "basicDataCache")
+       @NamedCache (cacheName = "basicDataCache", managementEnabled = true)
        private transient Cache<Long, BusinessBasicData> basicDataCache;
 
        /**
index c33698d267b97189f3208b2519bf09e5f7fbcc5c..e0d42fc24256bcb8ab7ae312c12d992d0b463a80 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.addressbook.beans.business.employee;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
@@ -25,9 +26,9 @@ import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
 import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.employee.Employee;
-import org.mxchange.addressbook.beans.BaseAddressbookController;
 
 /**
  * A request-scoped bean for general purposes for company employees.
@@ -53,7 +54,7 @@ public class AddressbookCompanyEmployeeWebRequestBean extends BaseAddressbookCon
         * List of all company employees
         */
        @Inject
-       @Cached(cacheName = "companyEmployeeCache")
+       @NamedCache (cacheName = "companyEmployeeCache", managementEnabled = true)
        private transient Cache<Long, Employee> companyEmployeeCache;
 
        /**
index 59598088d11f1112bea4bae5bb317baa25474266..995b6892ce61f9af0e2a1fc958e05caa260069f7 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.addressbook.beans.contact;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Collections;
 import java.util.Date;
@@ -24,6 +25,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
@@ -100,7 +102,7 @@ public class AddressbookContactWebRequestBean extends BaseAddressbookController
         * Contact list
         */
        @Inject
-       @Cached (cacheName = "contactsCache")
+       @NamedCache (cacheName = "contactsCache", managementEnabled = true)
        private transient Cache<Long, Contact> contactsCache;
 
        /**
@@ -117,7 +119,7 @@ public class AddressbookContactWebRequestBean extends BaseAddressbookController
         * Email address list
         */
        @Inject
-       @Cached (cacheName = "emailAddressCache")
+       @NamedCache (cacheName = "emailAddressCache", managementEnabled = true)
        private transient Cache<Long, String> emailAddressCache;
 
        /**
index 1b933fd2bc89670f81656f183c52248ae0e39c97..65bd07ce2ef2256e3fd27b99e9f166ae2bde61ad 100644 (file)
  */
 package org.mxchange.addressbook.beans.contact.phone;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
-import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
+import javax.cache.Cache;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
 import javax.inject.Inject;
@@ -68,7 +68,9 @@ public class AddressbookContactPhoneWebRequestBean extends BaseAddressbookContro
         * per each type is supported. Maybe later this will change into a OneToMany
         * relationship (one contact, many numbers).
         */
-       private final Map<DialableNumber, List<Contact>> contacts;
+       @Inject
+       @NamedCache (cacheName = "contactsPhoneCache", managementEnabled = true)
+       private transient Cache<DialableNumber, List<Contact>> contactsPhoneCache;
 
        /**
         * fax number
@@ -91,9 +93,6 @@ public class AddressbookContactPhoneWebRequestBean extends BaseAddressbookContro
        public AddressbookContactPhoneWebRequestBean () {
                // Call super constructor
                super();
-
-               // Init lists/maps
-               this.contacts = new HashMap<>(10);
        }
 
        /**
index 62b35dd4e67f649fa920e3b69fc28b22e0bc8f2f..7247d3756840ae058b45788bf6d2c1aa40a7dc97 100644 (file)
  */
 package org.mxchange.addressbook.beans.country;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
@@ -55,7 +57,7 @@ public class AddressbookCountryWebRequestBean extends BaseAddressbookController
         * List of all countries
         */
        @Inject
-       @Cached (cacheName = "countryCache")
+       @NamedCache (cacheName = "countryCache", managementEnabled = true)
        private transient Cache<Long, Country> countryCache;
 
        /**
index bf017338f4fbce0ce1219f4cecb787c9ed362ae0..d0f72af1e75e1d3c84c380320a44f7ceebc7b72f 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.addressbook.beans.mobileprovider;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -46,19 +47,19 @@ public class AddressbookMobileProviderWebRequestBean extends BaseAddressbookCont
         */
        private static final long serialVersionUID = 15_869_423_671_950_276L;
 
-       /**
-        * "Cached" list of mobile providers
-        */
-       @Inject
-       @Cached (cacheName = "mobileProviderCache")
-       private transient Cache<Long, MobileProvider> mobileProviderCache;
-
        /**
         * Remote EJB for mobile providers (regular)
         */
        @EJB (lookup = "java:global/addressbook-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote")
        private MobileProviderSingletonBeanRemote mobileProviderBean;
 
+       /**
+        * "Cached" list of mobile providers
+        */
+       @Inject
+       @NamedCache (cacheName = "mobileProviderCache", managementEnabled = true)
+       private transient Cache<Long, MobileProvider> mobileProviderCache;
+
        /**
         * Default constructor
         */
index 002b0cc1e8b6bb81580a42393909928fec01e1c0..d94cbc2eef08acebc8f469e10b6330be7b3d7aa1 100644 (file)
  */
 package org.mxchange.addressbook.beans.phone;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.event.Observes;
@@ -64,21 +66,21 @@ public class AddressbookPhoneWebRequestBean extends BaseAddressbookController im
         * All fax numbers
         */
        @Inject
-       @Cached(cacheName = "faxNumberCache")
+       @NamedCache (cacheName = "faxNumberCache", managementEnabled = true)
        private transient Cache<Long, DialableFaxNumber> faxNumberCache;
 
        /**
         * All land-line numbers
         */
        @Inject
-       @Cached(cacheName = "landLineNumberCache")
+       @NamedCache (cacheName = "landLineNumberCache", managementEnabled = true)
        private transient Cache<Long, DialableLandLineNumber> landLineNumberCache;
 
        /**
         * All mobile numbers
         */
        @Inject
-       @Cached(cacheName = "mobileNumberCache")
+       @NamedCache (cacheName = "mobileNumberCache", managementEnabled = true)
        private transient Cache<Long, DialableMobileNumber> mobileNumberCache;
 
        /**
index 1a3e537f10c964b75918b777a4d1e1f58828c7e9..c98e14fba8ea40bc0196c5c317f13cba979a3735 100644 (file)
@@ -29,12 +29,12 @@ import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
+import org.mxchange.addressbook.beans.contact.AddressbookContactWebRequestController;
 import org.mxchange.addressbook.beans.localization.AddressbookLocalizationSessionController;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcoreee.utils.FacesUtils;
-<<<<<<< HEAD:src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java
-import org.mxchange.addressbook.beans.BaseAddressbookController;
-import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -64,7 +64,6 @@ import org.mxchange.juserlogincore.container.login.UserLoginContainer;
 import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.juserlogincore.exceptions.UserPasswordRepeatMismatchException;
 import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.addressbook.beans.contact.AddressbookContactWebRequestController;
 
 /**
  * A user bean (controller)
@@ -215,7 +214,6 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle
         * @return Redirect outcome
         */
        public String addUser () {
-               System.out.println("addUser: this.contact=" + this.getContact());
                // As the form cannot validate the data (required="true"), check it here
                if (this.getUserName() == null) {
                        // Throw NPE
index d7e4050e982b9708a330df3243f98baee8b1675a..cdf18df4761639b440801ce021d6176bdd3d429f 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.addressbook.beans.user;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -23,6 +24,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
@@ -113,18 +115,18 @@ public class AddressbookUserWebRequestBean extends BaseAddressbookController imp
        @EJB (lookup = "java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
-       /**
-        * User id
-        */
-       private Long userId;
-
        /**
         * A list of all user profiles
         */
        @Inject
-       @Cached (cacheName = "userCache")
+       @NamedCache (cacheName = "userCache", managementEnabled = true)
        private transient Cache<Long, User> userCache;
 
+       /**
+        * User id
+        */
+       private Long userId;
+
        /**
         * Login controller (bean)
         */
@@ -140,7 +142,7 @@ public class AddressbookUserWebRequestBean extends BaseAddressbookController imp
         * User name list
         */
        @Inject
-       @Cached (cacheName = "userNameCache")
+       @NamedCache (cacheName = "userNameCache", managementEnabled = true)
        private transient Cache<Long, String> userNameCache;
 
        /**
index aaa04f01e9eaefeb0f6ff0978b78333aaef3824e..1d6321b5c7469a047be6c10d83e201c48ba91a86 100644 (file)
  */
 package org.mxchange.addressbook.beans.user.activity;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Collections;
 import java.util.GregorianCalendar;
 import java.util.LinkedList;
 import java.util.List;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
@@ -77,8 +79,8 @@ public class AddressbookUserActivityWebRequestBean extends BaseAddressbookContro
         * "Cache" for activity log per user
         */
        @Inject
-       @Cached(cacheName = "usersActivityCache")
-       private transient Cache<User, List<LogableUserActivity>> usersActivityCache;
+       @NamedCache (cacheName = "userActivityCache", managementEnabled = true)
+       private transient Cache<User, List<LogableUserActivity>> userActivityCache;
 
        /**
         * Default constructor
@@ -506,9 +508,9 @@ public class AddressbookUserActivityWebRequestBean extends BaseAddressbookContro
                List<LogableUserActivity> list = new LinkedList<>();
 
                // Is the user set?
-               if (this.usersActivityCache.containsKey(this.getUser())) {
+               if (this.userActivityCache.containsKey(this.getUser())) {
                        // Return it
-                       list.addAll(this.usersActivityCache.get(this.getUser()));
+                       list.addAll(this.userActivityCache.get(this.getUser()));
 
                        // Sort list and reverse it
                        Collections.sort(list, new UserActivityLogTimestampComparator());
@@ -548,13 +550,13 @@ public class AddressbookUserActivityWebRequestBean extends BaseAddressbookContro
                // Put all in map, per-user
                for (final LogableUserActivity userActivity : list) {
                        // Is the list there?
-                       if (!this.usersActivityCache.containsKey(userActivity.getActivityUser())) {
+                       if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) {
                                // Init list
-                               this.usersActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
+                               this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
                        }
 
                        // Add by user instance
-                       boolean added = this.usersActivityCache.get(userActivity.getActivityUser()).add(userActivity);
+                       boolean added = this.userActivityCache.get(userActivity.getActivityUser()).add(userActivity);
 
                        // Should be added
                        assert (added) : "Activity log not added"; //NOI18N
@@ -663,13 +665,13 @@ public class AddressbookUserActivityWebRequestBean extends BaseAddressbookContro
                }
 
                // Is it there?
-               if (!this.usersActivityCache.containsKey(userActivity.getActivityUser())) {
+               if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) {
                        // Init it
-                       this.usersActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
+                       this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
                }
 
                // Add activity to log
-               this.usersActivityCache.get(userActivity.getActivityUser()).add(userActivity);
+               this.userActivityCache.get(userActivity.getActivityUser()).add(userActivity);
        }
 
 }
index 0f1ff8696c68395b523d31ff0ab380e09f01fa47..8c11698950d789661c1cffdc03c656502b3b104c 100644 (file)
@@ -27,11 +27,11 @@ import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.user.AddressbookUserWebRequestController;
 import org.mxchange.jcoreee.events.helper.clear.HelperCleanupEvent;
 import org.mxchange.jcoreee.events.helper.clear.ObservableHelperCleanupEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
-<<<<<<< HEAD:src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java
-import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
@@ -41,7 +41,6 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
 import org.mxchange.juserlogincore.events.confirmation.UserConfirmedAccountEvent;
-import org.mxchange.addressbook.beans.user.AddressbookUserWebRequestController;
 
 /**
  * A web request bean for confirmation link handling
@@ -115,9 +114,6 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
 
        @Override
        public void maybeConfirmUserAccount () {
-               // Trace message
-               System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
                // Is the confirmation key set?
                if (this.getConfirmationKey() == null) {
                        // May be null if not set
@@ -130,9 +126,6 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
                // Now try to find the user in user list, first get the whole list
                List<User> users = this.userController.allUsers();
 
-               // Debug message
-               System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: users.size()={1}", this.getClass().getSimpleName(), users.size())); //NOI18N
-
                // Get iterator from it
                Iterator<User> iterator = users.iterator();
 
@@ -144,23 +137,14 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
                        // Get next user
                        User next = iterator.next();
 
-                       // Debug message
-                       System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: this.confirmationKey={1},next.confirmationKey={2}", this.getClass().getSimpleName(), this.getConfirmationKey(), next.getUserConfirmKey())); //NOI18N
-
                        // Same confirmation key?
                        if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) {
-                               // Debug message
-                               System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: next={1} - Aborting ...", this.getClass().getSimpleName(), next)); //NOI18N
-
                                // Found it, then set it and abort loop
                                user = next;
                                break;
                        }
                }
 
-               // Debug message
-               System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: user={1}", this.getClass().getSimpleName(), user)); //NOI18N
-
                // Is the user instance null?
                if ((null == user) || (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED)) {
                        // Then clear this bean and the helper
@@ -169,9 +153,6 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
                        // Try to confirm it
                        this.confirmUserAccount(user);
                }
-
-               // Trace message
-               System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
        /**
@@ -180,9 +161,6 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
         * @param user User instance
         */
        private void confirmUserAccount (final User user) {
-               // Trace message
-               System.out.println(MessageFormat.format("{0}.confirmUserAccount: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
                // Should be set
                if (null == user) {
                        // Throw NPE
@@ -214,14 +192,8 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
                        // Get base URL
                        String baseUrl = FacesUtils.generateBaseUrl();
 
-                       // Debug message
-                       System.out.println(MessageFormat.format("{0}.confirmUserAccount: baseUrl={1}", this.getClass().getSimpleName(), baseUrl)); //NOI18N
-
                        // Confirm account
                        updatedUser = this.userBean.confirmAccount(user, baseUrl);
-
-                       // Debug message
-                       System.out.println(MessageFormat.format("{0}.confirmUserAccount: updatedUser={1} - Returned from EJB", this.getClass().getSimpleName(), updatedUser)); //NOI18N
                } catch (final UserStatusConfirmedException | UserStatusLockedException ex) {
                        // Something unexpected happened
                        throw new FaceletException(MessageFormat.format("Cannot confirm user account {0}", user.getUserName()), ex); //NOI18N
@@ -230,14 +202,8 @@ public class AddressbookConfirmationLinkWebRequestBean extends BaseAddressbookCo
                // Fire event that the user has confirmed account
                this.userConfirmedEvent.fire(new UserConfirmedAccountEvent(updatedUser));
 
-               // Debug message
-               System.out.println(MessageFormat.format("{0}.confirmUserAccount: updatedUser={1}", this.getClass().getSimpleName(), updatedUser)); //NOI18N
-
                // Fire event
                this.userCreatedEvent.fire(new CreatedUserEvent(updatedUser));
-
-               // Trace message
-               System.out.println(MessageFormat.format("{0}.confirmUserAccount: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }
index 90579dd7930aa724d72f5be1f5e7fbcd42eb77e9..b29bce50e713eec9388d975b2d6f38fdfb58b277 100644 (file)
  */
 package org.mxchange.addressbook.beans.user.email_address;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
+import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.faces.view.facelets.FaceletException;
@@ -77,7 +79,7 @@ public class AddressbookEmailChangeWebRequestBean extends BaseAddressbookControl
         * Local list of already queued email addresses
         */
        @Inject
-       @Cached (cacheName = "queuedEmailCache")
+       @NamedCache (cacheName = "queuedEmailCache", managementEnabled = true)
        private transient Cache<String, Boolean> queuedEmailCache;
 
        /**