]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Please repeat/cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 23 Sep 2017 12:06:24 +0000 (14:06 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 23 Sep 2017 12:09:25 +0000 (14:09 +0200)
- added lookup attribute to @EJB annotation as some lookup did not work as
  expected and this is "guranteed" to work (if you have the right JNDI name,
  of course)
- plus all these EJBs can now be more distributed over separate EJB modules
  allowing a distributed operation over several data centers, awsome words,
  right? ;-)
- sorted members in base database bean

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jcontacts/model/phone/FinancialsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/FinancialsAdminBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/FinancialsAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/FinancialsUserEmailChangeSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/login/FinancialsUserLoginSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/FinancialsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/FinancialsResendLinkSessionBean.java

index cf500f785b69f8718a2260c3cf5c83f26553df51..aaabc9b75bf4c131d524a82b670387fc5644ec53 100644 (file)
@@ -46,7 +46,7 @@ public class FinancialsAdminContactPhoneSessionBean extends BaseFinancialsDataba
        /**
         * Contact EJB
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
        private ContactSessionBeanRemote contactBean;
 
        /**
index 893ca4e98f3965c0924ab50cdd3898fd07dcbd0c..51b4df2adc8aa3b2070b7f19da51f8616cd74b14 100644 (file)
@@ -43,7 +43,7 @@ public class FinancialsAdminBusinessDataSessionBean extends BaseFinancialsDataba
        /**
         * Administrative EJB
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote")
        private BasicCompanyDataSessionBeanRemote businessDataBean;
 
        /**
index 6f98e469e28b3fcdb960df55d74a072796a023f0..6941efa51a4f255bfe3f2b0ed049dc86523067a8 100644 (file)
@@ -43,7 +43,7 @@ public class FinancialsAdminBranchOfficeSessionBean extends BaseFinancialsDataba
        /**
         * General branch office bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/branchOffice!org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote")
        private BranchOfficeSessionBeanRemote branchOfficeBean;
 
        /**
index 3485a514d9a51a0456b72b73e1ea1d0c9929a13e..aa506433442053fdc4b62a9d61c49ddc8670d496 100644 (file)
@@ -80,6 +80,195 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean {
                super(factoryJndi, queueJndi);
        }
 
+       /**
+        * Get back a managed instance from given contact
+        * <p>
+        * @param contact Unmanaged/detached contact instance
+        * <p>
+        * @return Managed contact instance
+        */
+       protected Contact createManaged (final Contact contact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
+
+               // user should not be null
+               if (null == contact) {
+                       // Abort here
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() == null) {
+                       // Id is set
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
+               } else if (contact.getContactId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is null", contact.getContactId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());
+
+               // Should be there
+               assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
+
+               // Return it
+               return managedContact;
+       }
+
+       /**
+        * Get back a managed instance from given country
+        * <p>
+        * @param country Unmanaged/detached country instance
+        * <p>
+        * @return Managed country instance
+        */
+       protected Country createManaged (final Country country) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: country={1} - CALLED!", this.getClass().getSimpleName(), country)); //NOI18N
+
+               // user should not be null
+               if (null == country) {
+                       // Abort here
+                       throw new NullPointerException("country is null"); //NOI18N
+               } else if (country.getCountryId() == null) {
+                       // Id is set
+                       throw new NullPointerException("country.countryId is null"); //NOI18N
+               } else if (country.getCountryId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("country.countryId={0} is null", country.getCountryId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Country managedCountry = this.getEntityManager().find(CountryData.class, country.getCountryId());
+
+               // Should be there
+               assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedCountry={1} - EXIT!", this.getClass().getSimpleName(), managedCountry)); //NOI18N
+
+               // Return it
+               return managedCountry;
+       }
+
+       /**
+        * Get back a managed instance from given basic data
+        * <p>
+        * @param basicData Unmanaged/detached basic data instance
+        * <p>
+        * @return Managed basic data instance
+        */
+       protected BusinessBasicData createManaged (final BusinessBasicData basicData) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: basicData={1} - CALLED!", this.getClass().getSimpleName(), basicData)); //NOI18N
+
+               // user should not be null
+               if (null == basicData) {
+                       // Abort here
+                       throw new NullPointerException("basicData is null"); //NOI18N
+               } else if (basicData.getBasicDataId() == null) {
+                       // Id is set
+                       throw new NullPointerException("basicData.basicDataId is null"); //NOI18N
+               } else if (basicData.getBasicDataId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is null", basicData.getBasicDataId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final BusinessBasicData managedBasicData = this.getEntityManager().find(CompanyBasicData.class, basicData.getBasicDataId());
+
+               // Should be there
+               assert (managedBasicData instanceof BusinessBasicData) : "managedBasicData is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBasicData={1} - EXIT!", this.getClass().getSimpleName(), managedBasicData)); //NOI18N
+
+               // Return it
+               return managedBasicData;
+       }
+
+       /**
+        * Get back a managed instance from given employee
+        * <p>
+        * @param employee Unmanaged/detached employee instance
+        * <p>
+        * @return Managed employee instance
+        */
+       protected Employee createManaged (final Employee employee) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: employee={1} - CALLED!", this.getClass().getSimpleName(), employee)); //NOI18N
+
+               // user should not be null
+               if (null == employee) {
+                       // Abort here
+                       throw new NullPointerException("employee is null"); //NOI18N
+               } else if (employee.getEmployeeId() == null) {
+                       // Id is set
+                       throw new NullPointerException("employee.employeeId is null"); //NOI18N
+               } else if (employee.getEmployeeId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is null", employee.getEmployeeId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Employee managedEmployee = this.getEntityManager().find(CompanyEmployee.class, employee.getEmployeeId());
+
+               // Should be there
+               assert (managedEmployee instanceof Employee) : "managedEmployee is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedEmployee={1} - EXIT!", this.getClass().getSimpleName(), managedEmployee)); //NOI18N
+
+               // Return it
+               return managedEmployee;
+       }
+
+       /**
+        * Get back a managed instance from given user
+        * <p>
+        * @param user Unmanaged/detached user instance
+        * <p>
+        * @return Managed user instance
+        */
+       protected User createManaged (final User user) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
+
+               // user should not be null
+               if (null == user) {
+                       // Abort here
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Id is set
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N
+               } else if (user.getUserContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userContact is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() < 1) {
+                       // Not valid id number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is not valid", user.getUserContact().getContactId())); //NOI18N#
+               }
+
+               // Try to find it (should be there)
+               final User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
+
+               // Should be there
+               assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
+
+               // Return it
+               return managedUser;
+       }
+
        /**
         * Updates all contact's phone entry's created timestamps
         * <p>
@@ -278,195 +467,6 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean {
                return detachedNumber;
        }
 
-       /**
-        * Get back a managed instance from given contact
-        * <p>
-        * @param contact Unmanaged/detached contact instance
-        * <p>
-        * @return Managed contact instance
-        */
-       protected Contact createManaged (final Contact contact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
-
-               // user should not be null
-               if (null == contact) {
-                       // Abort here
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Id is set
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is null", contact.getContactId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());
-
-               // Should be there
-               assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
-
-               // Return it
-               return managedContact;
-       }
-
-       /**
-        * Get back a managed instance from given country
-        * <p>
-        * @param country Unmanaged/detached country instance
-        * <p>
-        * @return Managed country instance
-        */
-       protected Country createManaged (final Country country) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: country={1} - CALLED!", this.getClass().getSimpleName(), country)); //NOI18N
-
-               // user should not be null
-               if (null == country) {
-                       // Abort here
-                       throw new NullPointerException("country is null"); //NOI18N
-               } else if (country.getCountryId() == null) {
-                       // Id is set
-                       throw new NullPointerException("country.countryId is null"); //NOI18N
-               } else if (country.getCountryId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("country.countryId={0} is null", country.getCountryId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Country managedCountry = this.getEntityManager().find(CountryData.class, country.getCountryId());
-
-               // Should be there
-               assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedCountry={1} - EXIT!", this.getClass().getSimpleName(), managedCountry)); //NOI18N
-
-               // Return it
-               return managedCountry;
-       }
-
-       /**
-        * Get back a managed instance from given basic data
-        * <p>
-        * @param basicData Unmanaged/detached basic data instance
-        * <p>
-        * @return Managed basic data instance
-        */
-       protected BusinessBasicData createManaged (final BusinessBasicData basicData) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: basicData={1} - CALLED!", this.getClass().getSimpleName(), basicData)); //NOI18N
-
-               // user should not be null
-               if (null == basicData) {
-                       // Abort here
-                       throw new NullPointerException("basicData is null"); //NOI18N
-               } else if (basicData.getBasicDataId() == null) {
-                       // Id is set
-                       throw new NullPointerException("basicData.basicDataId is null"); //NOI18N
-               } else if (basicData.getBasicDataId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is null", basicData.getBasicDataId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final BusinessBasicData managedBasicData = this.getEntityManager().find(CompanyBasicData.class, basicData.getBasicDataId());
-
-               // Should be there
-               assert (managedBasicData instanceof BusinessBasicData) : "managedBasicData is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBasicData={1} - EXIT!", this.getClass().getSimpleName(), managedBasicData)); //NOI18N
-
-               // Return it
-               return managedBasicData;
-       }
-
-       /**
-        * Get back a managed instance from given employee
-        * <p>
-        * @param employee Unmanaged/detached employee instance
-        * <p>
-        * @return Managed employee instance
-        */
-       protected Employee createManaged (final Employee employee) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: employee={1} - CALLED!", this.getClass().getSimpleName(), employee)); //NOI18N
-
-               // user should not be null
-               if (null == employee) {
-                       // Abort here
-                       throw new NullPointerException("employee is null"); //NOI18N
-               } else if (employee.getEmployeeId() == null) {
-                       // Id is set
-                       throw new NullPointerException("employee.employeeId is null"); //NOI18N
-               } else if (employee.getEmployeeId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is null", employee.getEmployeeId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Employee managedEmployee = this.getEntityManager().find(CompanyEmployee.class, employee.getEmployeeId());
-
-               // Should be there
-               assert (managedEmployee instanceof Employee) : "managedEmployee is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedEmployee={1} - EXIT!", this.getClass().getSimpleName(), managedEmployee)); //NOI18N
-
-               // Return it
-               return managedEmployee;
-       }
-
-       /**
-        * Get back a managed instance from given user
-        * <p>
-        * @param user Unmanaged/detached user instance
-        * <p>
-        * @return Managed user instance
-        */
-       protected User createManaged (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Id is set
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N
-               } else if (user.getUserContact() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userContact is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() < 1) {
-                       // Not valid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is not valid", user.getUserContact().getContactId())); //NOI18N#
-               }
-
-               // Try to find it (should be there)
-               final User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
-
-               // Should be there
-               assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
-
-               // Return it
-               return managedUser;
-       }
-
        /**
         * Merges given contact's data
         * <p>
index f0924d4a037f5a7b4f367cc551a549b131c289df..550242e8080779529797ce812201e21836c007d7 100644 (file)
@@ -29,7 +29,6 @@ import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
 /**
  * An administrative user EJB
@@ -44,16 +43,10 @@ public class FinancialsAdminUserSessionBean extends BaseFinancialsDatabaseBean i
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Registration EJB
-        */
-       @EJB
-       private UserRegistrationSessionBeanRemote registerBean;
-
        /**
         * Regular user bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**
@@ -79,10 +72,10 @@ public class FinancialsAdminUserSessionBean extends BaseFinancialsDatabaseBean i
                }
 
                // Check if user is registered
-               if (this.registerBean.isUserNameRegistered(user)) {
+               if (this.userBean.isUserNameRegistered(user)) {
                        // Abort here
                        throw new UserNameAlreadyRegisteredException(user);
-               } else if (this.registerBean.isEmailAddressRegistered(user)) {
+               } else if (this.userBean.isEmailAddressRegistered(user)) {
                        // Abort here
                        throw new EmailAddressAlreadyRegisteredException(user);
                }
index bb99c45e2faa938af3be458f84664506add04ee5..301e4e4f99efe1f97b1b59a07697e139b225b4c8 100644 (file)
@@ -60,7 +60,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
        /**
         * Registration EJB
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/userRegistration!org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote")
        private UserRegistrationSessionBeanRemote registerBean;
 
        /**
index 9c74ab282eb8685aed270c10358653fb88e418b7..845cb1d8c6421e08c0ed5f0f50765d505f2aabc5 100644 (file)
@@ -46,7 +46,7 @@ public class FinancialsUserEmailChangeSessionBean extends BaseFinancialsDatabase
        /**
         * User bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**
@@ -111,7 +111,6 @@ public class FinancialsUserEmailChangeSessionBean extends BaseFinancialsDatabase
 
                // Persist it
                //@TODO Fix email delivery then allow this: this.getEntityManager().persist(emailChange);
-
                // Send email
                this.sendEmail("User email change", "user_email_change", emailChange.getEmailChangeUser(), baseUrl, null); //NOI18N
 
index d2b5a49a06bbf9aee46f4d7e1b5257921f7a64ea..11f794370afe1164cb4c1e4b030262a3f6300f92 100644 (file)
@@ -29,7 +29,6 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 import org.mxchange.juserlogincore.container.login.LoginContainer;
 import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
 import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
 /**
  * A session EJB for user logins
@@ -44,16 +43,10 @@ public class FinancialsUserLoginSessionBean extends BaseFinancialsDatabaseBean i
         */
        private static final long serialVersionUID = 21_785_978_127_581_965L;
 
-       /**
-        * Registration EJB
-        */
-       @EJB
-       private UserRegistrationSessionBeanRemote registerBean;
-
        /**
         * User EJB
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**
@@ -69,10 +62,6 @@ public class FinancialsUserLoginSessionBean extends BaseFinancialsDatabaseBean i
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: container={1} - CALLED!", this.getClass().getSimpleName(), container)); //NOI18N
 
-               // Check some beans
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-               assert (this.registerBean instanceof UserRegistrationSessionBeanRemote) : "this.registerBean is not set"; //NOI18N
-
                // user should not be null
                if (null == container) {
                        // Abort here
@@ -89,7 +78,7 @@ public class FinancialsUserLoginSessionBean extends BaseFinancialsDatabaseBean i
                }
 
                // Is the account there?
-               if (!this.registerBean.isUserNameRegistered(container.getUser())) {
+               if (!this.userBean.isUserNameRegistered(container.getUser())) {
                        // Not registered
                        throw new UserNotFoundException(container.getUser());
                }
index 5bc14a2c071c5071ff2f47e90c9c18b27b5dd3d3..e14efabd79ec081a39d248a9c3d0a47843f9e8c9 100644 (file)
@@ -48,13 +48,13 @@ public class FinancialsUserRegistrationSessionBean extends BaseFinancialsDatabas
        /**
         * Administrative user bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/adminUser!org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote")
        private AdminUserSessionBeanRemote adminUserBean;
 
        /**
         * Regular user EJB
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**
@@ -111,42 +111,6 @@ public class FinancialsUserRegistrationSessionBean extends BaseFinancialsDatabas
                return confirmationKey;
        }
 
-       @Override
-       public boolean isEmailAddressRegistered (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // Check bean
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               }
-
-               // Call other bean
-               return this.userBean.isEmailAddressRegistered(user);
-       }
-
-       @Override
-       public boolean isUserNameRegistered (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isUserNameRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // Check bean
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               }
-
-               // Call other bean
-               return this.userBean.isUserNameRegistered(user);
-       }
-
        @Override
        public User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
                // Trace message
@@ -168,10 +132,10 @@ public class FinancialsUserRegistrationSessionBean extends BaseFinancialsDatabas
                }
 
                // Check if user is registered
-               if (this.isUserNameRegistered(user)) {
+               if (this.userBean.isUserNameRegistered(user)) {
                        // Abort here
                        throw new UserNameAlreadyRegisteredException(user);
-               } else if (this.isEmailAddressRegistered(user)) {
+               } else if (this.userBean.isEmailAddressRegistered(user)) {
                        // Abort here
                        throw new EmailAddressAlreadyRegisteredException(user);
                }
index b2e1e6224b8071ecfba9206bb15dcf1b6848cfb4..6eaaee5c209db03121874f384e85d3c352aabe34 100644 (file)
@@ -46,13 +46,13 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsDatabaseBean
        /**
         * Registration bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/userRegistration!org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote")
        private UserRegistrationSessionBeanRemote registerBean;
 
        /**
         * Regular user bean
         */
-       @EJB
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
        /**