]> git.mxchange.org Git - addressbook-mailer-ejb.git/blobdiff - src/java/org/mxchange/jusercore/model/user/register/AddressbookUserRegistrationSessionBean.java
updated jar(s)
[addressbook-mailer-ejb.git] / src / java / org / mxchange / jusercore / model / user / register / AddressbookUserRegistrationSessionBean.java
index 707116eeb8c59b7ff2deedd125041f275b7a37c2..385111d9c1a72c22d88422ca47ea815725bf96f2 100644 (file)
@@ -19,18 +19,13 @@ package org.mxchange.jusercore.model.user.register;
 import java.text.MessageFormat;
 import java.util.Objects;
 import javax.ejb.EJB;
-import javax.ejb.EJBException;
 import javax.ejb.Stateless;
-import javax.mail.Address;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
-import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote;
 import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
@@ -42,7 +37,7 @@ import org.mxchange.jusercore.model.user.UserUtils;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Stateless (name = "register", description = "A bean handling the user registration")
+@Stateless (name = "userRegistration", description = "A bean handling the user registration")
 public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatabaseBean implements UserRegistrationSessionBeanRemote {
 
        /**
@@ -67,7 +62,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
         */
        public AddressbookUserRegistrationSessionBean () {
                // Call super constructor
-               super();
+               super("jms/addressbook-queue-factory", "jms/addressbook-email-queue"); //NOI18N
        }
 
        @Override
@@ -184,17 +179,6 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
                // Call other EJB
                User addedUser = this.adminUserBean.addUser(user);
 
-               // Init variable
-               Address emailAddress;
-
-               try {
-                       // Create email address and set
-                       emailAddress = new InternetAddress(addedUser.getUserContact().getContactEmailAddress());
-               } catch (final AddressException ex) {
-                       // Throw again
-                       throw new EJBException(ex);
-               }
-
                // Default template is with no random password
                String templateName = "user_registration"; //NOI18N
 
@@ -206,7 +190,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
 
                // Send email
                // @TODO: Internationlize the subject line somehow
-               this.sendEmail("Registration", templateName, emailAddress, addedUser, baseUrl, randomPassword); //NOI18N
+               this.sendEmail("Registration", templateName, addedUser, baseUrl, randomPassword); //NOI18N
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: addedUser={1},addedUser.userId={2} - EXIT!", this.getClass().getSimpleName(), addedUser, addedUser.getUserId())); //NOI18N