]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Tue, 29 Aug 2017 19:34:12 +0000 (21:34 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Aug 2017 19:34:12 +0000 (21:34 +0200)
- removed many PostConstruct methods as this was a bad idea anyway as it
  confuses the container while it is wrapping the managed beans into proxy
  objects. @EJB(lookup="full-JNDI-name") does fully replace this many code
- still I kept some there and may have to re-rename the now private method
- removed some JSF-only and some obsolete methods from interface and/or bean
- added GNU header to beans.xml

Signed-off-by: Roland Häder <roland@mxchange.org>
22 files changed:
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestController.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsContactPhoneWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/financial/income/FinancialsIncomeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/financial/receipt/FinancialsReceiptWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebApplicationBean.java
src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebSessionBean.java
web/WEB-INF/beans.xml

index 42441a6114383afe8d68774ef107242303cfd12f..40276230cb3c6fd93b92d91eae1ac93a317f9966 100644 (file)
  */
 package org.mxchange.jfinancials.beans.business.basicdata;
 
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.faces.FacesException;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData;
 import org.mxchange.jcontactsbusiness.employee.Employee;
 import org.mxchange.jcontactsbusiness.events.basicdata.added.AdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.headquarters.HeadquartersData;
 import org.mxchange.jcountry.data.Country;
@@ -41,7 +38,6 @@ import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
 
 /**
  * An administrative business contact bean (controller)
@@ -58,8 +54,9 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsCon
        private static final long serialVersionUID = 56_189_028_928_374L;
 
        /**
-        * Remote contact bean
+        * EJB for administrative purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote")
        private AdminBusinessDataSessionBeanRemote adminBusinessDataBean;
 
        /**
@@ -514,22 +511,4 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsCon
                this.landLineNumber = landLineNumber;
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.adminBusinessDataBean = (AdminBusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
 }
index f13a4bd2376a97ba73f885f67c11c1a2b78dbc09..10936c7ee7053d0750d776e767d6ee14427abbf4 100644 (file)
 package org.mxchange.jfinancials.beans.business.basicdata;
 
 import java.text.MessageFormat;
+import java.util.LinkedList;
 import java.util.List;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Observes;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote;
@@ -50,18 +47,20 @@ public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsControll
        private static final long serialVersionUID = 56_189_028_928_371L;
 
        /**
-        * Remote contact bean
+        * EJB for administrative basic business data purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote", description = "A stateless session bean for administrative purposes.")
        private AdminBusinessDataSessionBeanRemote adminBusinessDataBean;
 
        /**
         * A list of all registered companies (globally)
         */
-       private List<BusinessBasicData> businessContacts;
+       private final List<BusinessBasicData> businessContacts;
 
        /**
-        * Remote contact bean
+        * EJB for general basic business data purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
        private BusinessDataSessionBeanRemote businessDataBean;
 
        /**
@@ -121,6 +120,9 @@ public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsControll
        public FinancialsBusinessDataWebSessionBean () {
                // Call super constructor
                super();
+
+               // Init list
+               this.businessContacts = new LinkedList<>();
        }
 
        /**
@@ -151,6 +153,9 @@ public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsControll
                        throw new IllegalArgumentException("event.basicData.companyName is empty");
                }
 
+               // Initialize list
+               this.initializeList();
+
                // Add it to list
                this.businessContacts.add(event.getBasicData());
        }
@@ -162,6 +167,10 @@ public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsControll
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<BusinessBasicData> allCompanyBasicData () {
+               // Initialize list
+               this.initializeList();
+
+               // Return it
                return this.businessContacts;
        }
 
@@ -328,27 +337,14 @@ public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsControll
        }
 
        /**
-        * Post-initialization of this class
+        * Initializer method
         */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote"); //NOI18N
-
-                       // Try to lookup
-                       this.adminBusinessDataBean = (AdminBusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
+       private void initializeList () {
+               // Is the list empty?
+               if (this.businessContacts.isEmpty()) {
+                       // Init user's contact list
+                       this.businessContacts.addAll(this.adminBusinessDataBean.allCompanyBasicData());
                }
-
-               // Init user's contact list
-               this.businessContacts = this.adminBusinessDataBean.allCompanyBasicData();
        }
 
 }
index ae5a4879c8770157c1453e557f2a01055dc7e647..10940049f0f4e3ee09ac79641bbdc3f58c8d558c 100644 (file)
  */
 package org.mxchange.jfinancials.beans.business.employee;
 
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 
@@ -43,6 +39,7 @@ public class FinancialsAdminCompanyEmployeeWebRequestBean extends BaseFinancials
        /**
         * EJB for administrative company employee purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminCompanyEmployee!org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote")
        private AdminCompanyEmployeeSessionBeanRemote adminCompanyEmployeeBean;
 
        /**
@@ -53,22 +50,4 @@ public class FinancialsAdminCompanyEmployeeWebRequestBean extends BaseFinancials
                super();
        }
 
-       /**
-        * Initialization method
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.adminCompanyEmployeeBean = (AdminCompanyEmployeeSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminCompanyEmployee!org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
 }
index 3896e0e28dde4ca5faf77a3e4588fca13b7debda..a5f3d1aa0de3f7de1ba051e0ffb0de0c906ce145 100644 (file)
@@ -19,18 +19,14 @@ package org.mxchange.jfinancials.beans.contact;
 import java.text.MessageFormat;
 import java.util.Date;
 import java.util.Iterator;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
-import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
@@ -45,7 +41,6 @@ import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContac
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
@@ -84,14 +79,9 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsControll
        /**
         * Administrative contact EJB
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminContact!org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote")
        private AdminContactSessionBeanRemote adminContactBean;
 
-       /**
-        * Bean helper instance
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * Birth day
         */
@@ -108,8 +98,9 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsControll
        private String comment;
 
        /**
-        * Remote contact bean
+        * EJB for general contact purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote")
        private ContactSessionBeanRemote contactBean;
 
        /**
@@ -1047,40 +1038,6 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsControll
                this.zipCode = zipCode;
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-
-                       // Try to lookup (administative)
-                       this.adminContactBean = (AdminContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminContact!org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
-       @Override
-       @Deprecated
-       public boolean isPersonalTitleRequired () {
-               // Get context parameter
-               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_admin_personal_title_enabled"); //NOI18N
-
-               // Is it set?
-               boolean isRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
-
-               // Return value
-               return isRequired;
-       }
-
        @Override
        public void validateContactData () {
                if (this.getPersonalTitle() == null) {
index a52d835aa8dfeef6288df2980946738c169a0e9c..7966d9a072bdb1bb1338dcbd24c71df144b1c8ef 100644 (file)
@@ -55,15 +55,4 @@ public interface FinancialsAdminContactWebRequestController extends Serializable
        @Deprecated
        void setControllerType (final String controllerType);
 
-       /**
-        * Checks/returns whether the personal title (Mr./Mrs.) is required for this
-        * controller.
-        * <p>
-        * @return Whether personal title is required
-        * <p>
-        * @Deprecated Don't use this method
-        */
-       @Deprecated
-       boolean isPersonalTitleRequired ();
-
 }
index bf8a6ae7f0e61a7e7e8e328df1bff35198aaa192..b8d4814457b0f20f9de0b4164888c0c67c874fb3 100644 (file)
@@ -39,7 +39,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.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController;
@@ -94,7 +93,7 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im
        private String comment;
 
        /**
-        * Remote contact bean
+        * EJB for general contact purposes
         */
        private ContactSessionBeanRemote contactBean;
 
@@ -1110,41 +1109,12 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im
                return (Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat()));
        }
 
-       @Override
-       public Contact lookupContactById (final Long contactId) throws ContactNotFoundException {
-               // Init variable
-               Contact localContact = null;
-
-               // Clear this bean
-               this.clear();
-
-               // Try to lookup it in visible user list
-               for (final Iterator<Contact> iterator = this.contactList.iterator(); iterator.hasNext();) {
-                       // Get next user
-                       Contact next = iterator.next();
-
-                       // Is the user id found?
-                       if (Objects.equals(next.getContactId(), contactId)) {
-                               // Copy to other variable
-                               localContact = next;
-                               break;
-                       }
-               }
-
-               // Is it still null?
-               if (null == localContact) {
-                       // Not visible for the current user
-                       throw new ContactNotFoundException(contactId);
-               }
-
-               // Copy all data to this bean
-               this.copyContact(localContact);
-
-               // Return it
-               return localContact;
-       }
-
-       @Override
+       /**
+        * Returns a list of all selectable contacts for user creation. Contacts
+        * from already existing users are excluded in this list.
+        * <p>
+        * @return A list of all selectable contacts
+        */
        public List<Contact> selectableContacts () {
                return Collections.unmodifiableList(this.selectableContacts);
        }
index fa2ccf4bd4c5db7b266594ebd2fc51e9e4b3a4a7..b345e414feb13bdfcc71401d4690ce017dc3cc07 100644 (file)
@@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.contact;
 import java.io.Serializable;
 import java.util.List;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 
 /**
  * An interface for user beans
@@ -59,18 +58,6 @@ public interface FinancialsContactWebSessionController extends Serializable {
         */
        void updateContactDataFromController (final Contact userContact);
 
-       /**
-        * Tries to lookup contact by given id number. If the user is not found a
-        * proper exceptions are thrown.
-        * <p>
-        * @param contactId Contact id
-        * <p>
-        * @return Contact instance
-        * <p>
-        * @throws ContactNotFoundException If the user is not found
-        */
-       Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
-
        /**
         * Creates an instance from all properties
         * <p>
@@ -133,12 +120,4 @@ public interface FinancialsContactWebSessionController extends Serializable {
         */
        String doChangePersonalContactData ();
 
-       /**
-        * Returns a list of all selectable contacts for user creation. Contacts
-        * from already existing users are excluded in this list.
-        * <p>
-        * @return A list of all selectable contacts
-        */
-       List<Contact> selectableContacts ();
-
 }
index 2869e4d0277ba46a5ae6b82816661b9b6f304d26..4f4e71b198a846bf1bc60a6b64bb9b4d969a00cc 100644 (file)
@@ -18,17 +18,13 @@ package org.mxchange.jfinancials.beans.contact.phone;
 
 import java.text.MessageFormat;
 import java.util.Calendar;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
@@ -48,10 +44,10 @@ import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobi
 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jfinancials.beans.phone.FinancialsAdminPhoneWebRequestController;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
 import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -62,7 +58,6 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
 
 /**
  * An administrative contact phone controller (bean)
@@ -86,6 +81,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsCon
        /**
         * Administrative EJB for phone number
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminContactPhone!org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote")
        private AdminContactsPhoneSessionBeanRemote adminContactPhoneBean;
 
        /**
@@ -115,12 +111,6 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsCon
        @Inject
        private FinancialsAdminPhoneWebRequestController adminPhoneController;
 
-       /**
-        * Bean helper
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * Contact instance
         */
@@ -783,24 +773,6 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsCon
                this.phoneId = phoneId;
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the beans
-                       this.adminContactPhoneBean = (AdminContactsPhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminContactPhone!org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
        /**
         * Unlinks fax data with current contact
         * <p>
index 7b0aab6389b5a114f5f40e3a8eb940e769d6f11a..17ebaa4ca1f76a40dc8ab26d3f819e232d57d3a9 100644 (file)
@@ -34,15 +34,14 @@ import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLa
 import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebSessionController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
+import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 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.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
-import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
-import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
 
 /**
  * A general contact bean (controller)
@@ -58,12 +57,6 @@ public class FinancialsContactPhoneWebSessionBean extends BaseFinancialsControll
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Bean helper
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * General contact controller
         */
index a4b14762c43af7ba0bf18a97ccc08edb456d626a..a5cbab54c65e453e26949e06e6ac60e7ee5f87b9 100644 (file)
@@ -19,16 +19,13 @@ package org.mxchange.jfinancials.beans.country;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
@@ -66,6 +63,7 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsControll
        /**
         * Remote country EJB
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote")
        private CountrySingletonBeanRemote countryBean;
 
        /**
@@ -263,24 +261,6 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsControll
                this.countryPhoneCode = countryPhoneCode;
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               // Try this
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the bean
-                       this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw
-                       throw new FaceletException(ex);
-               }
-       }
-
        /**
         * Clears this bean's data. This should be called after a form has been
         * submitted and the processing of the form was successful.
index 33c4e5d9f7c7b982bc05062c8fba0b0547f7ed96..61f2bc1db80c3244b5c2f0d3e7ec6c610bdff5ba 100644 (file)
@@ -19,14 +19,10 @@ package org.mxchange.jfinancials.beans.financial.income;
 import java.text.MessageFormat;
 import java.util.Arrays;
 import java.util.List;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
 import org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote;
@@ -49,8 +45,9 @@ public class FinancialsIncomeWebRequestBean extends BaseFinancialsController imp
        private static final long serialVersionUID = 56_189_028_928_371L;
 
        /**
-        * Remote contact bean
+        * EJB for general financial income purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote")
        private FinancialIncomeSessionBeanRemote financialBean;
 
        /**
@@ -159,22 +156,4 @@ public class FinancialsIncomeWebRequestBean extends BaseFinancialsController imp
                this.incomeTitle = incomeTitle;
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.financialBean = (FinancialIncomeSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
 }
index 3dc1aabf81926bba492a44372fc213964596db16..fc9cfba2e34d315cd51333fc87486c8120034166 100644 (file)
@@ -21,15 +21,12 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Observes;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
@@ -55,8 +52,9 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im
        private static final long serialVersionUID = 56_189_028_928_371L;
 
        /**
-        * Remote contact bean
+        * EJB for general financial receipt purposes
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.receipt.FinancialReceiptSessionBeanRemote")
        private FinancialReceiptSessionBeanRemote financialBean;
 
        /**
@@ -272,24 +270,6 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im
                this.receiptNumber = receiptNumber;
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.financialBean = (FinancialReceiptSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.receipt.FinancialReceiptSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
        /**
         * Checks if receipt has already been added to database
         * <p>
index dc37cfb4a4516682191bd0c128b3503d66b6cc17..bd065c0717c62dd2d427a2f6a9d05558d2b069ad 100644 (file)
@@ -19,16 +19,13 @@ package org.mxchange.jfinancials.beans.mobileprovider;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent;
@@ -55,6 +52,7 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsC
        /**
         * Remote EJB for mobile providers (administrative)
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminMobileProvider!org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote")
        private AdminMobileProviderSessionBeanRemote adminRemoteBean;
 
        /**
@@ -208,24 +206,6 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsC
                this.providerName = providerName;
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the beans
-                       this.adminRemoteBean = (AdminMobileProviderSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminMobileProvider!org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw it again
-                       throw new FaceletException(e);
-               }
-       }
-
        /**
         * Checks whether if the given mobile provider is already created by
         * checking both dial prefix and country.
index 544b624efe9fd5d9d8c82b90226959dce889e518..e99b72fcf362a154d2357a85b0a869a4b2d07ec1 100644 (file)
@@ -20,20 +20,15 @@ import java.text.MessageFormat;
 import java.util.Calendar;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent;
@@ -86,14 +81,9 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsController
        /**
         * Remote EJB for phone number (administrative)
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminPhone!org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote")
        private AdminPhoneSessionBeanRemote adminPhoneBean;
 
-       /**
-        * Bean helper
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * fax number
         */
@@ -914,24 +904,6 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsController
                this.phoneNumber = phoneNumber;
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the beans
-                       this.adminPhoneBean = (AdminPhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminPhone!org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw it again
-                       throw new FaceletException(e);
-               }
-       }
-
        /**
         * Returns an instance of a DialableFaxNumber from all fields stored in this
         * bean.
index 5ba476ba1c935394aded12e6a77f4841525bf589..6bdde803e83dd412a06da733bf9fa06591b82ac3 100644 (file)
@@ -37,7 +37,6 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.contact.FinancialsAdminContactWebRequestController;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebSessionController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -100,12 +99,6 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsController
         */
        private AdminUserSessionBeanRemote adminUserBean;
 
-       /**
-        * Bean helper
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * Contact instance
         */
index 999e95b2d74937830f87f1263df0bf6092be7630..a958858e458ccb74895b9438a834dc294ef0e006 100644 (file)
@@ -27,13 +27,11 @@ import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.event.Observes;
 import javax.faces.view.facelets.FaceletException;
-import javax.inject.Inject;
 import javax.inject.Named;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
 import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
@@ -68,12 +66,6 @@ public class FinancialsUserActivityWebApplicationBean extends BaseFinancialsCont
         */
        private static final long serialVersionUID = 192_586_376_717_856_904L;
 
-       /**
-        * Bean helper
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * User instance
         */
index dffd27d58275dc8e46aa327e36a2fbf6833b58f8..1de8906da11b0105b28a9aea722d3c1b1cebb41e 100644 (file)
@@ -34,7 +34,6 @@ import org.mxchange.jcoreee.events.helper.clear.HelperCleanupEvent;
 import org.mxchange.jcoreee.events.helper.clear.ObservableHelperCleanupEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.helper.FinancialsWebRequestHelperController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController;
 import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -60,12 +59,6 @@ public class FinancialsConfirmationLinkWebRequestBean extends BaseFinancialsCont
         */
        private static final long serialVersionUID = 57_637_182_796_370L;
 
-       /**
-        * Bean helper instance
-        */
-       @Inject
-       private FinancialsWebRequestHelperController beanHelper;
-
        /**
         * Event being fired when a bean helper should be cleaned
         */
index c107383a54f25e956211b7b5fe0688d76b68d2ac..622c071f15aa302f2f0b23c6310e23a259579632 100644 (file)
@@ -20,18 +20,14 @@ import java.text.MessageFormat;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
 import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -107,6 +103,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsController
        /**
         * Remote register session-scoped bean
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/userLogin!org.mxchange.juserlogincore.model.user.login.UserLoginSessionBeanRemote")
        private UserLoginSessionBeanRemote userLoginBean;
 
        /**
@@ -131,6 +128,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsController
        /**
         * EJB for user's password history
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/userPasswordHistory!org.mxchange.jusercore.model.user.password_history.UserPasswordHistorySessionBeanRemote")
        private UserPasswordHistorySessionBeanRemote userPasswordHistoryBean;
 
        /**
@@ -341,29 +339,6 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsController
                return ((this.isUserLoggedIn()) && (Objects.equals(this.getLoggedInUser().getUserMustChangePassword(), Boolean.TRUE)));
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.userLoginBean = (UserLoginSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userLogin!org.mxchange.juserlogincore.model.user.login.UserLoginSessionBeanRemote"); //NOI18N
-
-                       // Also find this
-                       this.userPasswordHistoryBean = (UserPasswordHistorySessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userPasswordHistory!org.mxchange.jusercore.model.user.password_history.UserPasswordHistorySessionBeanRemote"); //NOI18N
-
-                       // Defaul template is guest
-                       this.baseTemplatePathName = GUEST_BASE_TEMPLATE_NAME;
-               } catch (final NamingException ex) {
-                       // Continue to throw
-                       throw new FaceletException(ex);
-               }
-       }
-
        @Override
        public boolean isInvisible () {
                // Check on login
index 445728ccda2957efb48a6e4813f231bdf8dab1ac..d88201839e3b1d94ab80a73256b2a267a335e54a 100644 (file)
 package org.mxchange.jfinancials.beans.user.password;
 
 import java.util.Objects;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
@@ -65,6 +62,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsControll
        /**
         * Remote user bean
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**
@@ -179,7 +177,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsControll
                        PasswordHistory passwordHistory = this.userBean.updateUserPassword(user, baseUrl);
 
                        // Fire event
-                       this.userUpdatedPasswordEvent.fire(new UpdatedUserPasswordEvent(passwordHistory,this.getUserPassword()));
+                       this.userUpdatedPasswordEvent.fire(new UpdatedUserPasswordEvent(passwordHistory, this.getUserPassword()));
                } catch (final UserNotFoundException | UserStatusUnconfirmedException | UserStatusLockedException ex) {
                        // Clear bean
                        this.clear();
@@ -249,24 +247,6 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsControll
                this.userPasswordRepeat = userPasswordRepeat;
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.userBean = (UserSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
        @Override
        public boolean isRequiredChangePasswordSet () {
                // Is all data set?
index 553ef3a85a534bf6e830bee2b8a76a0453fec49d..030fc10717b7b7c658154ba6ded51714eb8c0c24 100644 (file)
  */
 package org.mxchange.jfinancials.beans.user.register;
 
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.UserContact;
 import org.mxchange.jcoreee.utils.FacesUtils;
@@ -72,6 +69,20 @@ public class FinancialsUserRegisterWebSessionBean extends BaseFinancialsControll
        @Inject
        private FinancialsAdminUserWebRequestController adminUserController;
 
+       /**
+        * An event being fired when a user name should be cleared
+        */
+       @Inject
+       @Any
+       private Event<ObservableClearUserNameEvent> clearUserNameEvent;
+
+       /**
+        * An event being fired when a user password should be cleared
+        */
+       @Inject
+       @Any
+       private Event<ObservableClearUserPasswordEvent> clearUserPasswordEvent;
+
        /**
         * Contact controller
         */
@@ -87,6 +98,7 @@ public class FinancialsUserRegisterWebSessionBean extends BaseFinancialsControll
        /**
         * Remote register session-scoped bean
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/userRegistration!org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote")
        private UserRegistrationSessionBeanRemote registerBean;
 
        /**
@@ -102,20 +114,6 @@ public class FinancialsUserRegisterWebSessionBean extends BaseFinancialsControll
        @Any
        private Event<ObservableUpdatedUserPasswordEvent> userPasswordChangedEvent;
 
-       /**
-        * An event being fired when a user name should be cleared
-        */
-       @Inject
-       @Any
-       private Event<ObservableClearUserNameEvent> clearUserNameEvent;
-
-       /**
-        * An event being fired when a user password should be cleared
-        */
-       @Inject
-       @Any
-       private Event<ObservableClearUserPasswordEvent> clearUserPasswordEvent;
-
        /**
         * An event being fired when a new user has registered
         */
@@ -325,21 +323,4 @@ public class FinancialsUserRegisterWebSessionBean extends BaseFinancialsControll
                return "user_register_page2"; //NOI18N
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.registerBean = (UserRegistrationSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userRegistration!org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw
-                       throw new FaceletException(ex);
-               }
-       }
-
 }
index d8a39971ff19323dd39aca2a9284812b490eedd6..56ecd73d0ddc59940c3f5cc5bd0965a62a3d248f 100644 (file)
 package org.mxchange.jfinancials.beans.user.resendlink;
 
 import java.util.Locale;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
-import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
@@ -76,6 +72,7 @@ public class FinancialsResendLinkWebSessionBean extends BaseFinancialsController
        /**
         * EJB for resending confirmation link
         */
+       @EJB (lookup = "java:global/jfinancials-ejb/userResendConfirmationLink!org.mxchange.juserlogincore.model.user.resendlink.ResendLinkSessionBeanRemote")
        private ResendLinkSessionBeanRemote resendLinkBean;
 
        /**
@@ -214,24 +211,6 @@ public class FinancialsResendLinkWebSessionBean extends BaseFinancialsController
                this.emailAddress = emailAddress;
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.resendLinkBean = (ResendLinkSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userResendConfirmationLink!org.mxchange.juserlogincore.model.user.resendlink.ResendLinkSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-       }
-
        /**
         * Clears email address fields so the user has to re-enter them
         */
index 0f4e2aab0e708698686e988a1a5ce99eb3702041..604563e42f59448924cb5ce7458e8e34eabe8cc1 100644 (file)
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2016, 2017 Roland Häder
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
 <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"