From: Roland Häder Date: Sun, 3 Sep 2017 15:50:06 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8cfd660e2c35d31c376908044688b1e24d3d4137;p=jjobs-war.git Please cherry-pick: - removed not needed constructor from converter/validator - reverted `@EJB` annotation in mobile-provider converter as it was not working Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java b/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java index 441c73ce..9cbf1eb7 100644 --- a/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java +++ b/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java @@ -43,12 +43,6 @@ public class JobsBusinessContactConverter implements Converter { */ private static CompanyEmployeeSessionBeanRemote COMPANY_EMPLOYEE_BEAN; - /** - * Default constructor - */ - public JobsCompanyEmployeeConverter () { - } - @Override public Employee getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/converter/business/headquarters/JobsCompanyHeadquartersConverter.java b/src/java/org/mxchange/jjobs/converter/business/headquarters/JobsCompanyHeadquartersConverter.java index 4f3b82e9..64e770eb 100644 --- a/src/java/org/mxchange/jjobs/converter/business/headquarters/JobsCompanyHeadquartersConverter.java +++ b/src/java/org/mxchange/jjobs/converter/business/headquarters/JobsCompanyHeadquartersConverter.java @@ -43,12 +43,6 @@ public class JobsCompanyHeadquartersConverter implements Converter { */ private static ContactSessionBeanRemote CONTACT_BEAN; - /** - * Default constructor - */ - public JobsContactConverter () { - } - @Override public Contact getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java b/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java index 69e3a8c4..0ab11920 100644 --- a/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java +++ b/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java @@ -44,12 +44,6 @@ public class JobsCountryConverter implements Converter { */ private static CountrySingletonBeanRemote COUNTRY_BEAN; - /** - * Default constructor - */ - public JobsCountryConverter () { - } - @Override public Country getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java b/src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java index a469d940..ebfaeeb6 100644 --- a/src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java +++ b/src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java @@ -43,12 +43,6 @@ public class JobsFaxNumberConverter implements Converter { */ private static PhoneSessionBeanRemote PHONE_BEAN; - /** - * Default constructor - */ - public JobsFaxNumberConverter () { - } - @Override public DialableFaxNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java b/src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java index 398c117e..ec321022 100644 --- a/src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java +++ b/src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java @@ -43,12 +43,6 @@ public class JobsLandLineNumberConverter implements Converter { /** * Mobile provider bean */ - @EJB(lookup = "java:global/jjobs-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote") - private MobileProviderSingletonBeanRemote mobileProviderBean; - - /** - * Default constructor - */ - public JobsMobileProviderConverter () { - } + private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN; @Override public MobileProvider getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { + // Is the instance there? + if (MOBILE_PROVIDER_BEAN == null) { + try { + // Not yet, attempt lookup + Context initial = new InitialContext(); + + // Lookup EJB + MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); + } catch (final NamingException ex) { + // Throw it again + throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); + } + } + // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { // Warning message @@ -58,7 +69,7 @@ public class JobsMobileProviderConverter implements Converter { } // Get full list - List providerList = this.mobileProviderBean.allMobileProviders(); + List providerList = this.MOBILE_PROVIDER_BEAN.allMobileProviders(); // Init value MobileProvider provider = null; diff --git a/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java b/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java index ed606e48..49226c81 100644 --- a/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java +++ b/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java @@ -42,12 +42,6 @@ public class JobsUserConverter implements Converter { */ private static UserSessionBeanRemote USER_BEAN; - /** - * Default constructor - */ - public JobsUserConverter () { - } - @Override public User getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java b/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java index f30e8beb..14d7603f 100644 --- a/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java +++ b/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java @@ -36,12 +36,6 @@ public class JobsBirthdayValidator extends BaseDateValidator { */ private static final long serialVersionUID = 28_735_756_819_460L; - /** - * Default constructor - */ - public JobsBirthdayValidator () { - } - @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // All accepted, required fields diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java index 0c99d953..1b015ccc 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java @@ -57,12 +57,6 @@ public class JobsEmailAddressValidator extends BaseStringValidator { */ private static final long serialVersionUID = 187_536_745_607_192L; - /** - * Default constructor - */ - public JobsEmailAddressValidator () { - } - @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // Is the instance there? diff --git a/src/java/org/mxchange/jjobs/validator/url/JobsUrlValidator.java b/src/java/org/mxchange/jjobs/validator/url/JobsUrlValidator.java index e2be8435..9afaf9de 100644 --- a/src/java/org/mxchange/jjobs/validator/url/JobsUrlValidator.java +++ b/src/java/org/mxchange/jjobs/validator/url/JobsUrlValidator.java @@ -49,12 +49,6 @@ public class JobsUrlValidator extends BaseStringValidator { */ private static final long serialVersionUID = 187_536_745_607_193L; - /** - * Default constructor - */ - public JobsUrlValidator () { - } - @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // The required field diff --git a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java index 4c6b0420..d005666f 100644 --- a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java +++ b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java @@ -46,12 +46,6 @@ public class JobsUserIdValidator extends BaseNumberValidator { */ private static final long serialVersionUID = 12_869_569_314_764_690L; - /** - * Default constructor - */ - public JobsUserIdValidator () { - } - @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // Is the instance there?