From: Roland Häder Date: Sun, 3 Sep 2017 01:31:36 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4d17e1ccd2f71218f56721731447c38d33dd2b4c;p=addressbook-war.git Please cherry-pick: - 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 --- diff --git a/lib/gf-client.jar b/lib/gf-client.jar deleted file mode 100644 index 2f369f3b..00000000 Binary files a/lib/gf-client.jar and /dev/null differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties index 847addc6..db384dcd 100644 --- a/lib/nblibraries.properties +++ b/lib/nblibraries.properties @@ -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 index 00000000..02de279f Binary files /dev/null and b/lib/payara-api/payara-api.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 7102b0c8..5e2b7471 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -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 diff --git a/nbproject/project.xml b/nbproject/project.xml index ccd9087b..dbe35262 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -75,9 +75,6 @@ ${file.reference.cdi-api.jar} - - ${file.reference.gf-client.jar} - ${libs.apache_poi.classpath} WEB-INF/lib @@ -88,6 +85,9 @@ ${libs.cache.classpath} + + ${libs.payara-api.classpath} + diff --git a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebRequestBean.java index 47c6a218..51a65f58 100644 --- a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebRequestBean.java @@ -16,11 +16,13 @@ */ 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 basicDataCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java index c33698d2..e0d42fc2 100644 --- a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java @@ -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 companyEmployeeCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebRequestBean.java index 59598088..995b6892 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebRequestBean.java @@ -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 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 emailAddressCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebRequestBean.java index 1b933fd2..65bd07ce 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebRequestBean.java @@ -16,12 +16,12 @@ */ 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> contacts; + @Inject + @NamedCache (cacheName = "contactsPhoneCache", managementEnabled = true) + private transient Cache> 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); } /** diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebRequestBean.java index 62b35dd4..7247d375 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebRequestBean.java @@ -16,11 +16,13 @@ */ 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 countryCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java index bf017338..d0f72af1 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java @@ -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 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 mobileProviderCache; + /** * Default constructor */ diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebRequestBean.java index 002b0cc1..d94cbc2e 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebRequestBean.java @@ -16,12 +16,14 @@ */ 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 faxNumberCache; /** * All land-line numbers */ @Inject - @Cached(cacheName = "landLineNumberCache") + @NamedCache (cacheName = "landLineNumberCache", managementEnabled = true) private transient Cache landLineNumberCache; /** * All mobile numbers */ @Inject - @Cached(cacheName = "mobileNumberCache") + @NamedCache (cacheName = "mobileNumberCache", managementEnabled = true) private transient Cache mobileNumberCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java index 1a3e537f..c98e14fb 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java @@ -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 diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebRequestBean.java index d7e4050e..cdf18df4 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebRequestBean.java @@ -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 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 userNameCache; /** diff --git a/src/java/org/mxchange/addressbook/beans/user/activity/AddressbookUserActivityWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/activity/AddressbookUserActivityWebRequestBean.java index aaa04f01..1d6321b5 100644 --- a/src/java/org/mxchange/addressbook/beans/user/activity/AddressbookUserActivityWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/activity/AddressbookUserActivityWebRequestBean.java @@ -16,12 +16,14 @@ */ 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> usersActivityCache; + @NamedCache (cacheName = "userActivityCache", managementEnabled = true) + private transient Cache> userActivityCache; /** * Default constructor @@ -506,9 +508,9 @@ public class AddressbookUserActivityWebRequestBean extends BaseAddressbookContro List 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()); + this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList()); } // 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()); + this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList()); } // Add activity to log - this.usersActivityCache.get(userActivity.getActivityUser()).add(userActivity); + this.userActivityCache.get(userActivity.getActivityUser()).add(userActivity); } } diff --git a/src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java index 0f1ff869..8c116989 100644 --- a/src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java @@ -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 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 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 } } diff --git a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebRequestBean.java index 90579dd7..b29bce50 100644 --- a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebRequestBean.java @@ -16,11 +16,13 @@ */ 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 queuedEmailCache; /**