@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
// 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
- }
- }
}
*/
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
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
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
- }
- }
}