]> git.mxchange.org Git - jbonuscard-lib.git/commitdiff
Organized members to general structure
authorRoland Haeder <roland@mxchange.org>
Fri, 19 Feb 2016 14:30:58 +0000 (15:30 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 19 Feb 2016 14:30:58 +0000 (15:30 +0100)
src/org/mxchange/addressbook/validator/addressbook/AddressbookIdValidator.java
src/org/mxchange/addressbook/validator/user/UserIdValidator.java

index daccc42c458b7bcb70bd9a3f8b1334c21d708437..e396e446a34afb75c508a51e1795adbbf9fbc4c2 100644 (file)
@@ -56,6 +56,26 @@ public class AddressbookIdValidator extends BaseLongValidator {
        @Log
        private LoggerBeanLocal loggerBeanLocal;
 
+       /**
+        * Public consutructor
+        */
+       public AddressbookIdValidator () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+                       // ... and user controller
+                       this.addressbookBean = (AddressbookSessionBeanRemote) context.lookup("java:global/addressbook-ejb/addressbook!org.mxchange.addressbook.model.addressbook.AddressbookSessionBeanRemote"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+               }
+       }
+
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Trace message
@@ -97,24 +117,4 @@ public class AddressbookIdValidator extends BaseLongValidator {
                // Trace message
                this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
        }
-
-       /**
-        * Public consutructor
-        */
-       public AddressbookIdValidator () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
-                       // ... and user controller
-                       this.addressbookBean = (AddressbookSessionBeanRemote) context.lookup("java:global/addressbook-ejb/addressbook!org.mxchange.addressbook.model.addressbook.AddressbookSessionBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
-               }
-       }
 }
index 2f504686334499acbd450d79506af594bdab00fd..9333f73a7062dc0367a126e7093145068cfe6518 100644 (file)
@@ -54,16 +54,36 @@ public class UserIdValidator extends BaseLongValidator implements Validator {
         */
        private static final long serialVersionUID = 12_869_569_314_764_690L;
 
+       /**
+        * Logger instance
+        */
+       @Log
+       private LoggerBeanLocal loggerBeanLocal;
+
        /**
         * Remote bean
         */
        private UserSessionBeanRemote userBean;
 
        /**
-        * Logger instance
+        * Initialization of this converter
         */
-       @Log
-       private LoggerBeanLocal loggerBeanLocal;
+       public UserIdValidator () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+                       // ... and user controller
+                       this.userBean = (UserSessionBeanRemote) context.lookup("java:global/juser-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+               }
+       }
 
        /**
         * Event fired when the user registration is complete
@@ -93,13 +113,13 @@ public class UserIdValidator extends BaseLongValidator implements Validator {
                User registeredUser = event.getUser();
 
                // Debug message
-               System.out.println(MessageFormat.format("UserIdValidator:afterRegistrationEvent: registeredUser={0}", registeredUser)); //NOI18N
+               this.loggerBeanLocal.logDebug(MessageFormat.format("UserIdValidator:afterRegistrationEvent: registeredUser={0}", registeredUser)); //NOI18N
 
                // Update cache
                UserIdValidator.cachedStatus.add(registeredUser.getUserId());
 
                // Trace message
-               System.out.println("UserIdValidator:afterRegistrationEvent: EXIT!"); //NOI18N
+               this.loggerBeanLocal.logTrace("UserIdValidator:afterRegistrationEvent: EXIT!"); //NOI18N
        }
 
        @Override
@@ -141,23 +161,4 @@ public class UserIdValidator extends BaseLongValidator implements Validator {
                this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
        }
 
-       /**
-        * Initialization of this converter
-        */
-       public UserIdValidator () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
-                       // ... and user controller
-                       this.userBean = (UserSessionBeanRemote) context.lookup("java:global/juser-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
-               }
-       }
 }