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=8fd877f0aeabd727ec35ec9f88738b134a324613;p=pizzaservice-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 e8a87089..94a5e000 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-5.3.jar libs.primefaces.displayName=PrimeFaces 5.3 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 9e5d9687..7d73b937 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.jcontacts-business-core.jar=lib/jcontacts-business-core.jar file.reference.jcontacts-business-lib.jar=lib/jcontacts-business-lib.jar file.reference.jcontacts-core.jar=lib/jcontacts-core.jar @@ -98,10 +97,10 @@ javac.classpath=\ ${reference.pizzaservice-core.jar}:\ ${reference.pizzaservice-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 0fddd02c..02b1a1f0 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -81,9 +81,6 @@ ${file.reference.cdi-api.jar} - - ${file.reference.gf-client.jar} - ${libs.apache_poi.classpath} @@ -93,6 +90,9 @@ ${libs.cache.classpath} + + ${libs.payara-api.classpath} + diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java index 2b40cfc3..bdd880e7 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java @@ -16,11 +16,13 @@ */ package org.mxchange.pizzaapplication.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; @@ -56,7 +58,7 @@ public class PizzaBusinessDataWebRequestBean extends BasePizzaController impleme * 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/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java index 5ab3a04f..f7ec105a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.business.employee; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -53,7 +54,7 @@ public class PizzaCompanyEmployeeWebRequestBean extends BasePizzaController impl * 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/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java index 45a22202..25a065ba 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java @@ -42,9 +42,9 @@ import org.mxchange.jshopcore.wrapper.CheckoutWrapper; import org.mxchange.jshopcore.wrapper.WrapableCheckout; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.basket.PizzaBasketWebSessionController; +import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestController; import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionController; import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestHelperController; -import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestController; import org.mxchange.pizzaapplication.beans.receipt.PizzaReceiptWebRequestController; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java index a6b79abd..7d374b89 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.contact; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Collections; import java.util.Date; @@ -24,8 +25,9 @@ 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.SessionScoped; +import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -38,7 +40,6 @@ import org.mxchange.jcontacts.model.contact.ContactUtils; import org.mxchange.jcontacts.model.contact.UserContact; import org.mxchange.jcontacts.model.contact.title.PersonalTitle; import org.mxchange.jcountry.model.data.Country; -import org.mxchange.jfinancials.beans.user.PizzaUserWebRequestController; import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; @@ -54,6 +55,7 @@ import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent; import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent; import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException; import org.mxchange.pizzaapplication.beans.BasePizzaController; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebRequestController; import org.mxchange.pizzaapplication.beans.user.login.PizzaUserLoginWebSessionController; /** @@ -62,7 +64,7 @@ import org.mxchange.pizzaapplication.beans.user.login.PizzaUserLoginWebSessionCo * @author Roland Häder */ @Named ("contactController") -@SessionScoped +@RequestScoped public class PizzaContactWebRequestBean extends BasePizzaController implements PizzaContactWebRequestController { /** @@ -100,7 +102,7 @@ public class PizzaContactWebRequestBean extends BasePizzaController implements P * Contact list */ @Inject - @Cached (cacheName = "contactsCache") + @NamedCache (cacheName = "contactsCache", managementEnabled = true) private transient Cache contactsCache; /** @@ -117,7 +119,7 @@ public class PizzaContactWebRequestBean extends BasePizzaController implements P * Email address list */ @Inject - @Cached (cacheName = "emailAddressCache") + @NamedCache (cacheName = "emailAddressCache", managementEnabled = true) private transient Cache emailAddressCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java index 1ee88627..b804ab1b 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java @@ -25,7 +25,6 @@ import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; import javax.inject.Inject; import javax.inject.Named; -import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; @@ -41,6 +40,7 @@ import org.mxchange.jcontacts.events.mobile.linked.AdminLinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontacts.model.phone.AdminContactsPhoneSessionBeanRemote; import org.mxchange.jcountry.model.data.Country; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; @@ -52,9 +52,9 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; -import org.mxchange.jphone.model.phonenumbers.model.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber; -import org.mxchange.jphone.model.phonenumbers.model.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.phone.PizzaAdminPhoneWebRequestController; diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java index 3de41314..7c1ffd64 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java @@ -16,11 +16,13 @@ */ package org.mxchange.pizzaapplication.beans.contact.phone; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.LinkedList; import java.util.List; import java.util.Objects; -import javax.enterprise.context.SessionScoped; +import javax.cache.Cache; +import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; @@ -47,7 +49,7 @@ import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestControl * @author Roland Häder */ @Named ("contactPhoneController") -@SessionScoped +@RequestScoped public class PizzaContactPhoneWebRequestBean extends BasePizzaController implements PizzaContactPhoneWebRequestController { /** @@ -67,7 +69,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme * relationship (one contact, many numbers). */ @Inject - @Cached(cacheName = "contactsPhoneCache") + @NamedCache (cacheName = "contactsPhoneCache", managementEnabled = true) private transient Cache> contactsPhoneCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java index fb4e088e..eaa490f3 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java @@ -16,11 +16,13 @@ */ package org.mxchange.pizzaapplication.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 PizzaCountryWebRequestBean extends BasePizzaController implements P * List of all countries */ @Inject - @Cached (cacheName = "countryCache") + @NamedCache (cacheName = "countryCache", managementEnabled = true) private transient Cache countryCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java index d623fd7d..4eacb4e0 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.mobileprovider; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -56,7 +57,7 @@ public class PizzaMobileProviderWebRequestBean extends BasePizzaController imple * "Cached" list of mobile providers */ @Inject - @Cached (cacheName = "mobileProviderCache") + @NamedCache (cacheName = "mobileProviderCache", managementEnabled = true) private transient Cache mobileProviderCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java index 5c5e2a96..dca8cd8c 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java @@ -16,14 +16,16 @@ */ package org.mxchange.pizzaapplication.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.context.RequestScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; @@ -52,7 +54,7 @@ import org.mxchange.pizzaapplication.beans.BasePizzaController; * @author Roland Häder */ @Named ("phoneController") -@ApplicationScoped +@RequestScoped public class PizzaPhoneWebRequestBean extends BasePizzaController implements PizzaPhoneWebRequestController { /** @@ -64,21 +66,21 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz * 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/pizzaapplication/beans/receipt/PizzaReceiptWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebRequestBean.java index 8d17abec..a27cc1fd 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebRequestBean.java @@ -17,7 +17,7 @@ package org.mxchange.pizzaapplication.beans.receipt; import javax.annotation.PostConstruct; -import javax.enterprise.context.SessionScoped; +import javax.enterprise.context.RequestScoped; import javax.faces.FacesException; import javax.inject.Inject; import javax.inject.Named; @@ -34,7 +34,7 @@ import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestHelperControlle * @author Roland Häder */ @Named ("receiptController") -@SessionScoped +@RequestScoped public class PizzaReceiptWebRequestBean extends BasePizzaController implements PizzaReceiptWebRequestController { /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java index 24cc2a1c..a86c7186 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.user; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -23,8 +24,9 @@ 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.SessionScoped; +import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; @@ -34,7 +36,6 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent; -import org.mxchange.jfinancials.beans.user.PizzaUserWebRequestController; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent; import org.mxchange.jusercore.events.user.clear.username.ObservableClearUserNameEvent; @@ -70,7 +71,7 @@ import org.mxchange.pizzaapplication.beans.user.login.PizzaUserLoginWebSessionCo * @author Roland Häder */ @Named ("userController") -@SessionScoped +@RequestScoped public class PizzaUserWebRequestBean extends BasePizzaController implements PizzaUserWebRequestController { /** @@ -114,18 +115,18 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz @EJB (lookup = "java:global/jfinancials-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) */ @@ -141,7 +142,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz * User name list */ @Inject - @Cached (cacheName = "userNameCache") + @NamedCache (cacheName = "userNameCache", managementEnabled = true) private transient Cache userNameCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java index d3d0dec7..665ffb88 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java @@ -44,16 +44,6 @@ public interface PizzaUserWebRequestController extends Serializable { */ String getUserPassword (); - /** - * Clears both user passwords - */ - void clearUserPasswords (); - - /** - * Clears user name - */ - void clearUserName (); - /** * Checks if both user passwords are left empty and if this is enabled * (allowed) in context parameter. If true, the calling bean should create a @@ -71,13 +61,6 @@ public interface PizzaUserWebRequestController extends Serializable { */ List allUsers (); - /** - * All public user profiles - *

- * @return A list of all public user profiles - */ - List allVisibleUsers (); - /** * Checks whether the given contact is a user *

@@ -87,14 +70,6 @@ public interface PizzaUserWebRequestController extends Serializable { */ boolean isContactFound (final Contact contact); - /** - * Checks whether a public user account is registered. This means that at - * least one user profile has its flag "public user profile" enabled. - *

- * @return Whether at least one user has a public profile - */ - boolean isVisibleUserFound (); - /** * Checks whether given user instance's name is used *

diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java index 7cfdde38..c9857a12 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java @@ -16,12 +16,14 @@ */ package org.mxchange.pizzaapplication.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 PizzaUserActivityWebRequestBean extends BasePizzaController impleme * "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 PizzaUserActivityWebRequestBean extends BasePizzaController impleme 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 PizzaUserActivityWebRequestBean extends BasePizzaController impleme // 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 PizzaUserActivityWebRequestBean extends BasePizzaController impleme } // 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/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java index a94f08d0..9391927a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java @@ -16,13 +16,15 @@ */ package org.mxchange.pizzaapplication.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.enterprise.context.RequestScoped; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -43,7 +45,7 @@ import org.mxchange.pizzaapplication.beans.user.login.PizzaUserLoginWebSessionCo * @author Roland Häder */ @Named ("userEmailChangeController") -@SessionScoped +@RequestScoped public class PizzaEmailChangeWebRequestBean extends BasePizzaController implements PizzaEmailChangeWebRequestController { /** @@ -77,7 +79,7 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaController implemen * Local list of already queued email addresses */ @Inject - @Cached (cacheName = "queuedEmailCache") + @NamedCache (cacheName = "queuedEmailCache", managementEnabled = true) private transient Cache queuedEmailCache; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java index 44b682af..e7dfd6bb 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java @@ -26,7 +26,6 @@ import javax.inject.Named; import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontacts.model.contact.UserContact; import org.mxchange.jcoreee.utils.FacesUtils; -import org.mxchange.jfinancials.beans.user.PizzaUserWebRequestController; import org.mxchange.jusercore.events.user.clear.password.ClearUserPasswordEvent; import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent; import org.mxchange.jusercore.events.user.clear.username.ClearUserNameEvent; @@ -48,6 +47,7 @@ import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestController; import org.mxchange.pizzaapplication.beans.features.PizzaFeaturesWebApplicationController; import org.mxchange.pizzaapplication.beans.user.PizzaAdminUserWebRequestController; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebRequestController; /** * A web bean for user registration diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java index 63d428bc..386794d8 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java @@ -18,7 +18,7 @@ package org.mxchange.pizzaapplication.beans.user.resendlink; import java.util.Locale; import javax.ejb.EJB; -import javax.enterprise.context.SessionScoped; +import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; @@ -26,7 +26,6 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent; import org.mxchange.jcoreee.utils.FacesUtils; -import org.mxchange.jfinancials.beans.user.PizzaUserWebRequestController; import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; @@ -38,6 +37,7 @@ import org.mxchange.juserlogincore.events.resendlink.UserResendLinkAccountEvent; import org.mxchange.juserlogincore.model.user.resendlink.ResendLinkSessionBeanRemote; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.localization.PizzaLocalizationSessionController; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebRequestController; /** * A web session-scoped bean for resending confirmation link @@ -45,7 +45,7 @@ import org.mxchange.pizzaapplication.beans.localization.PizzaLocalizationSession * @author Roland Häder */ @Named ("userResendConfirmationController") -@SessionScoped +@RequestScoped public class PizzaResendLinkWebRequestBean extends BasePizzaController implements PizzaResendLinkWebRequestController { /**