]> git.mxchange.org Git - jjobs-war.git/commitdiff
converters don't have a postconstruct possiblity and no injections/EJBs. So you need...
authorRoland Haeder <roland@mxchange.org>
Mon, 15 Feb 2016 18:54:25 +0000 (19:54 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 15 Feb 2016 18:54:25 +0000 (19:54 +0100)
src/java/org/mxchange/addressbook/converter/country/CountryConverter.java
src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java
src/java/org/mxchange/addressbook/converter/user/UserConverter.java

index 6606143d2ac5edce433212d00859d5c3ac188e63..c758b39d79880c9667da67a8c0825cc9c8d26f53 100644 (file)
@@ -19,18 +19,16 @@ package org.mxchange.addressbook.converter.country;
 import java.text.MessageFormat;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.FacesConverter;
-import javax.inject.Inject;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.addressbook.beans.country.CountryWebApplicationController;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+import org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote;
 import org.mxchange.jcountry.data.Country;
 
 /**
@@ -44,8 +42,7 @@ public class CountryConverter implements Converter {
        /**
         * Country bean
         */
-       @Inject
-       private CountryWebApplicationController countryController;
+       private AddressbookCountrySingletonBeanRemote countryController;
 
        /**
         * Logger instance
@@ -56,7 +53,7 @@ public class CountryConverter implements Converter {
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Trace message
-               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: contect={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
+               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: contect={0},component={1},submittedValue={2},this.countryController={3} - CALLED!", context, component, submittedValue, this.countryController)); //NOI18N
 
                // Get full list
                List<Country> countryList = this.countryController.allCountries();
@@ -120,8 +117,7 @@ public class CountryConverter implements Converter {
        /**
         * Initialization of this converter
         */
-       @PostConstruct
-       public void init () {
+       public CountryConverter () {
                // Try to get it
                try {
                        // Get initial context
@@ -129,6 +125,9 @@ public class CountryConverter implements Converter {
 
                        // Lookup logger
                        this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+                       // ... and country controller
+                       this.countryController = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote"); //NOI18N
                } catch (final NamingException ex) {
                        // Continue to throw it
                        throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
index 0769fb534ecf5e695d4a021f1e4d33c75ea5a71d..464c113e46cf7441303d810e6bf3ff686e780856 100644 (file)
@@ -19,18 +19,16 @@ package org.mxchange.addressbook.converter.smsprovider;
 import java.text.MessageFormat;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.FacesConverter;
-import javax.inject.Inject;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.addressbook.beans.smsprovider.SmsProviderWebApplicationController;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+import org.mxchange.jphone.phonenumbers.smsprovider.AddressbookSmsProviderSingletonBeanRemote;
 import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
 
 /**
@@ -50,8 +48,7 @@ public class SmsProviderConverter implements Converter {
        /**
         * SMS provider bean
         */
-       @Inject
-       private SmsProviderWebApplicationController providerController;
+       private AddressbookSmsProviderSingletonBeanRemote providerController;
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
@@ -120,8 +117,7 @@ public class SmsProviderConverter implements Converter {
        /**
         * Initialization of this converter
         */
-       @PostConstruct
-       public void init () {
+       public SmsProviderConverter () {
                // Try to get it
                try {
                        // Get initial context
@@ -129,6 +125,9 @@ public class SmsProviderConverter implements Converter {
 
                        // Lookup logger
                        this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+                       /// and SMS provider controller
+                       this.providerController = (AddressbookSmsProviderSingletonBeanRemote) context.lookup("java:global/addressbook-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.AddressbookSmsProviderSingletonBeanRemote"); //NOI18N
                } catch (final NamingException ex) {
                        // Continue to throw it
                        throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
index d5e7769400ab21b2beec1c026940f465b3a05278..769dc443b2c8a826c4adff8bf5d5945b984dc262 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.addressbook.converter.user;
 
 import java.text.MessageFormat;
-import javax.annotation.PostConstruct;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
@@ -115,8 +114,7 @@ public class UserConverter implements Converter {
        /**
         * Initialization of this converter
         */
-       @PostConstruct
-       public void init () {
+       public UserConverter () {
                // Try to get it
                try {
                        // Get initial context
@@ -124,6 +122,9 @@ public class UserConverter implements Converter {
 
                        // 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.userController = (UserWebSessionController) 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