- /**
- * Initialization of this converter
- */
- public JobsLandLineNumberConverter () {
- // 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.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+ @Override
+ public DialableLandLineNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the instance there?
+ if (PHONE_CONTROLLER == null) {
+ // Get bean from CDI directly
+ PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();