import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal;
+import org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote;
import org.mxchange.jcountry.data.Country;
/**
/**
* Remote country EJB
*/
- private final AddressbookCountrySingletonBeanLocal countryBean;
+ private final AddressbookCountrySingletonBeanRemote countryBean;
/**
* List of all countries
Context context = new InitialContext();
// Try to lookup the bean
- this.countryBean = (AddressbookCountrySingletonBeanLocal) context.lookup("ejb/addressbook-singleton-country"); //NOI18N
+ this.countryBean = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N
} catch (final NamingException ex) {
// Continue to throw
throw new FaceletException(ex);
@Log
private LoggerBeanLocal loggerBeanLocal;
- /**
- * Initialization of this converter
- */
- @PostConstruct
- public void init () {
- // 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
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
- }
- }
-
@Override
public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Trace message
return String.valueOf(((Country) value).getCountryId());
}
+ /**
+ * Initialization of this converter
+ */
+ @PostConstruct
+ public void init () {
+ // 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
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+ }
+ }
}