From df92f0e0f90ebfe4e4e7ed9c066cb4677cf3599a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 1 Jul 2017 12:12:15 +0200 Subject: [PATCH] Please cherry-pick: - don't have observer methods in interfaces around as interfaces on web beans (aka. controllers) are for direct method calls, not for CDI events - added missing @Observes annotation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../contact/JobsContactWebSessionBean.java | 2 +- .../phone/JobsPhoneWebApplicationBean.java | 83 ++++++++++++-- .../JobsPhoneWebApplicationController.java | 106 ------------------ .../beans/user/JobsUserWebSessionBean.java | 2 +- 4 files changed, 73 insertions(+), 120 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index db1ebb23..7d2d88c4 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -280,7 +280,7 @@ public abstract class JobsContactWebSessionBean extends BaseJobsController imple } /** - * Event observer for newly added users by adminstrator + * Event observer for newly added users by administrator *

* @param event Event being fired */ diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java index fe68e3fa..a13129b3 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java @@ -99,7 +99,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.landLineNumbers = new LinkedList<>(); } - @Override + /** + * Observes events being fired when an administrator has added a new + * contact. + *

+ * @param event Event being fired + */ public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) { // The event must be valid if (null == event) { @@ -123,7 +128,11 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Event observer for newly added users by administrator + *

+ * @param event Event being fired + */ public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) { // event should not be null if (null == event) { @@ -147,7 +156,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a fax + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedFaxNumberEvent (@Observes final AdminDeletedFaxNumberEvent event) { // event should not be null if (null == event) { @@ -171,7 +185,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a land-line + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedLandLineNumberEvent (@Observes final AdminDeletedLandLineNumberEvent event) { // event should not be null if (null == event) { @@ -195,7 +214,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a mobile + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedMobileNumberEvent (@Observes final AdminDeletedMobileNumberEvent event) { // event should not be null if (null == event) { @@ -219,7 +243,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has a linked a fax + * number + *

+ * @param event Event being fired + */ public void afterAdminLinkedFaxNumberEvent (@Observes final ObservableAdminLinkedFaxNumberEvent event) { // Is the event fine? if (event == null) { @@ -255,7 +284,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp } } - @Override + /** + * Observes events being fired when an administrator has a linked a + * land-line number + *

+ * @param event Event being fired + */ public void afterAdminLinkedLandLineNumberEvent (@Observes final ObservableAdminLinkedLandLineNumberEvent event) { // Is the event fine? if (event == null) { @@ -291,7 +325,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp } } - @Override + /** + * Observes events being fired when an administrator has a linked a mobile + * number + *

+ * @param event Event being fired + */ public void afterAdminLinkedMobileNumberEvent (@Observes final ObservableAdminLinkedMobileNumberEvent event) { // Is the event fine? if (event == null) { @@ -327,7 +366,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp } } - @Override + /** + * Observes events being fired when an administrator has updated contact + * data. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) { // event should not be null if (null == event) { @@ -351,7 +395,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a fax + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedFaxNumberEvent (@Observes final AdminUpdatedFaxNumberEvent event) { // event should not be null if (null == event) { @@ -375,7 +424,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a land-line + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedLandLineNumberEvent (@Observes final AdminUpdatedLandLineNumberEvent event) { // event should not be null if (null == event) { @@ -399,7 +453,12 @@ public abstract class JobsPhoneWebApplicationBean extends BaseJobsController imp this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a mobile + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedMobileNumberEvent (@Observes final AdminUpdatedMobileNumberEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationController.java index bda59956..03ade1cb 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationController.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationController.java @@ -19,21 +19,9 @@ package org.mxchange.jjobs.beans.phone; import java.io.Serializable; import java.util.List; import javax.ejb.Local; -import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; -import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent; -import org.mxchange.jphone.events.landline.deleted.AdminDeletedLandLineNumberEvent; -import org.mxchange.jphone.events.landline.updated.AdminUpdatedLandLineNumberEvent; -import org.mxchange.jphone.events.mobile.deleted.AdminDeletedMobileNumberEvent; -import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; -import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; -import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; -import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent; -import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent; -import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; /** * An interface for a request web controller (bean) for administrative phone @@ -44,100 +32,6 @@ import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNu @Local public interface JobsPhoneWebApplicationController extends Serializable { - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event); - - /** - * Observes events being fired when an administrator has deleted a fax - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedFaxNumberEvent (final AdminDeletedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has deleted a land-line - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedLandLineNumberEvent (final AdminDeletedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has deleted a mobile - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedMobileNumberEvent (final AdminDeletedMobileNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a fax - * number - *

- * @param event Event being fired - */ - void afterAdminLinkedFaxNumberEvent (final ObservableAdminLinkedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a - * land-line number - *

- * @param event Event being fired - */ - void afterAdminLinkedLandLineNumberEvent (final ObservableAdminLinkedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a mobile - * number - *

- * @param event Event being fired - */ - void afterAdminLinkedMobileNumberEvent (final ObservableAdminLinkedMobileNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a fax - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedFaxNumberEvent (final AdminUpdatedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a land-line - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedLandLineNumberEvent (final AdminUpdatedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a mobile - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedMobileNumberEvent (final AdminUpdatedMobileNumberEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event); - /** * Returns a list of all mobile numbers. For performance reasons, the * controller (bean) should be application-scoped as from user to user diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index b9afa68c..5a96c1bd 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -196,7 +196,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs *

* @param event Event being fired */ - public void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event) { + public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) { // event should not be null if (null == event) { // Throw NPE -- 2.39.5