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=c6c4ecad8677e04658b8a4089da8e1d594ab2411;p=jjobs-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 6997be26..4a78467a 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 0001f4de..d8f0439d 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -40,7 +40,6 @@ file.reference.jaddressbook-lib.jar=lib/jaddressbook-lib.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.cdi-api.jar=lib/cdi-api.jar -file.reference.gf-client.jar=lib/gf-client.jar file.reference.jcontacts-core.jar=lib/jcontacts-core.jar file.reference.jcontacts-lib.jar=lib/jcontacts-lib.jar file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar @@ -90,10 +89,10 @@ javac.classpath=\ ${reference.jjobs-core.jar}:\ ${reference.jjobs-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 f1ab73d0..fc4a88cb 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -69,9 +69,6 @@ ${file.reference.cdi-api.jar} - - ${file.reference.gf-client.jar} - ${libs.apache_poi.classpath} @@ -81,6 +78,9 @@ ${libs.cache.classpath} + + ${libs.payara-api.classpath} + diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java index 403f3804..62f5ba12 100644 --- a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.business.basicdata; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -30,7 +31,6 @@ import org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemo import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote; import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jcountry.data.Country; import org.mxchange.jjobs.beans.BaseJobsController; @@ -58,7 +58,7 @@ public class JobsBusinessDataWebRequestBean extends BaseJobsController implement * 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/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java index 9db724ff..6fe69dd6 100644 --- a/src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.business.employee; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -27,7 +28,6 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote; import org.mxchange.jcontactsbusiness.employee.Employee; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; /** @@ -54,7 +54,7 @@ public class JobsCompanyEmployeeWebRequestBean extends BaseJobsController implem * 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/jjobs/beans/contact/JobsContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java index 2e795106..8079c240 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.contact; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Collections; import java.util.Date; @@ -37,7 +38,6 @@ import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.title.PersonalTitle; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jcountry.data.Country; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.user.JobsUserWebRequestController; @@ -101,7 +101,7 @@ public class JobsContactWebRequestBean extends BaseJobsController implements Job * Contact list */ @Inject - @Cached (cacheName = "contactsCache") + @NamedCache (cacheName = "contactsCache", managementEnabled = true) private transient Cache contactsCache; /** @@ -118,7 +118,7 @@ public class JobsContactWebRequestBean extends BaseJobsController implements Job * Email address list */ @Inject - @Cached (cacheName = "emailAddressCache") + @NamedCache (cacheName = "emailAddressCache", managementEnabled = true) private transient Cache emailAddressCache; /** diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java index 865a63cc..ae18da6e 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.contact.phone; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.LinkedList; import java.util.List; @@ -30,7 +31,6 @@ import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContac import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent; import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent; @@ -68,7 +68,7 @@ public class JobsContactPhoneWebRequestBean extends BaseJobsController implement * 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/jjobs/beans/country/JobsCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java index 2d659480..6394bb23 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.country; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -26,7 +27,6 @@ import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jcountry.data.Country; import org.mxchange.jcountry.data.CountrySingletonBeanRemote; import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent; @@ -56,7 +56,7 @@ public class JobsCountryWebRequestBean extends BaseJobsController implements Job * List of all countries */ @Inject - @Cached (cacheName = "countryCache") + @NamedCache (cacheName = "countryCache", managementEnabled = true) private transient Cache countryCache; /** diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java index cc71c8d4..e53fb33c 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.mobileprovider; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -27,7 +28,6 @@ import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; @@ -57,7 +57,7 @@ public class JobsMobileProviderWebRequestBean extends BaseJobsController impleme * "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/jjobs/beans/phone/JobsPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestBean.java index c945b114..94748e70 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.phone; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -33,7 +34,6 @@ import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContac import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent; import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent; @@ -65,21 +65,21 @@ public class JobsPhoneWebRequestBean extends BaseJobsController implements JobsP * 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/jjobs/beans/user/JobsUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java index 435417fc..a42107a5 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.user; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.LinkedList; @@ -34,7 +35,6 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController; import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController; @@ -118,7 +118,7 @@ public class JobsUserWebRequestBean extends BaseJobsController implements JobsUs * A list of all user profiles */ @Inject - @Cached (cacheName = "userCache") + @NamedCache (cacheName = "userCache", managementEnabled = true) private transient Cache userCache; /** @@ -141,7 +141,7 @@ public class JobsUserWebRequestBean extends BaseJobsController implements JobsUs * User name list */ @Inject - @Cached (cacheName = "userNameCache") + @NamedCache (cacheName = "userNameCache", managementEnabled = true) private transient Cache userNameCache; /** diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestController.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestController.java index 0c97da20..3e71e8c1 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestController.java @@ -61,13 +61,6 @@ public interface JobsUserWebRequestController 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 *

@@ -77,14 +70,6 @@ public interface JobsUserWebRequestController 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/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java index 5f397216..e483a6fd 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.user.activity; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Collections; import java.util.GregorianCalendar; @@ -27,7 +28,6 @@ import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent; @@ -78,8 +78,8 @@ public class JobsUserActivityWebRequestBean extends BaseJobsController implement * "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 @@ -507,9 +507,9 @@ public class JobsUserActivityWebRequestBean extends BaseJobsController implement 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()); @@ -549,13 +549,13 @@ public class JobsUserActivityWebRequestBean extends BaseJobsController implement // 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 @@ -664,13 +664,13 @@ public class JobsUserActivityWebRequestBean extends BaseJobsController implement } // 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/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java index b78e2ef5..e853cad0 100644 --- a/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.jjobs.beans.user.email_address; +import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Iterator; import java.util.List; @@ -27,7 +28,6 @@ import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcoreee.jcache.Cached; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController; @@ -78,7 +78,7 @@ public class JobsEmailChangeWebRequestBean extends BaseJobsController implements * Local list of already queued email addresses */ @Inject - @Cached (cacheName = "queuedEmailCache") + @NamedCache (cacheName = "queuedEmailCache", managementEnabled = true) private transient Cache queuedEmailCache; /**