import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jjobs.beans.phone.JobsPhoneWebRequestController;
+import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
/**
* Converter for mobile id <-> valid mobile instance
/**
* Phone EJB
*/
- private static PhoneSessionBeanRemote PHONE_BEAN;
+ private static JobsPhoneWebRequestController PHONE_CONTROLLER;
@Override
public DialableMobileNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Is the instance there?
- if (PHONE_BEAN == null) {
+ if (PHONE_CONTROLLER == null) {
try {
// Not yet, attempt lookup
final Context initial = new InitialContext();
// Lookup EJB
- PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote");
+ PHONE_CONTROLLER = (JobsPhoneWebRequestController) initial.lookup("java:module/phoneController!org.mxchange.jjobs.beans.phone.JobsPhoneWebRequestController");
} catch (final NamingException ex) {
// Throw it again
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
}
}
final Long mobileNumberId = Long.valueOf(submittedValue);
// Try to get mobile instance from it
- mobileNumber = PHONE_BEAN.findMobileNumberById(mobileNumberId);
+ mobileNumber = PHONE_CONTROLLER.findMobileNumberById(mobileNumberId);
} catch (final NumberFormatException ex) {
// Throw again
throw new ConverterException(ex);