From: Roland Haeder Date: Sun, 10 Apr 2016 11:18:54 +0000 (+0200) Subject: Used global, portable JNDI names for all beans X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7f5325f7867f6e6eccf6807f53a7903d77760af4;p=pizzaservice-war.git Used global, portable JNDI names for all beans --- diff --git a/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java b/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java index 30769b0a..f0f1c629 100644 --- a/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java +++ b/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java @@ -57,6 +57,9 @@ public class PizzaCategoryConverter implements Converter { // Get initial context Context context = new InitialContext(); + // Lookup category bean + this.categoryBean = (CategorySessionBeanRemote) context.lookup("java:global/jshop-ejb/category, java:global/jshop-ejb/category!org.mxchange.jshopcore.model.category.CategorySessionBeanRemote"); //NOI18N + // 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) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java index be085512..7093a3f3 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java @@ -80,7 +80,7 @@ public class PizzaBasketWebSessionBean implements PizzaBasketWebSessionControlle Context context = new InitialContext(); // Try to lookup - this.basketBean = (BasketSessionBeanRemote) context.lookup("ejb/stateless-basket"); //NOI18N + this.basketBean = (BasketSessionBeanRemote) context.lookup("java:global/jshop-ejb/basket, java:global/jshop-ejb/basket!org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw throw new FaceletException(ex); diff --git a/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java index 67622e0e..e1a067bc 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java @@ -78,7 +78,7 @@ public class PizzaAdminCategoryWebRequestBean implements PizzaAdminCategoryWebRe Context context = new InitialContext(); // Try to lookup the bean - this.categoryBean = (AdminCategorySessionBeanRemote) context.lookup("ejb/stateless-admin-category"); //NOI18N + this.categoryBean = (AdminCategorySessionBeanRemote) context.lookup("java:global/jshop-ejb/admin_category!org.mxchange.jshopcore.model.category.AdminCategorySessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw it again throw new FaceletException(e); diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java index 5a052a7b..494b9d94 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java @@ -131,7 +131,7 @@ public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionContr Context context = new InitialContext(); // Try to lookup - this.customerBean = (CustomerSessionBeanRemote) context.lookup("ejb/stateless-customer"); + this.customerBean = (CustomerSessionBeanRemote) context.lookup("java:global/jshop-ejb/shopCustomer, java:global/jshop-ejb/shopCustomer!org.mxchange.jcustomercore.model.customer.CustomerSessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e); diff --git a/src/java/org/mxchange/pizzaapplication/beans/product/PizzaAdminProductWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/product/PizzaAdminProductWebRequestBean.java index 17d8bd9e..b8ebc234 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/product/PizzaAdminProductWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/product/PizzaAdminProductWebRequestBean.java @@ -90,7 +90,7 @@ public class PizzaAdminProductWebRequestBean implements PizzaAdminProductWebRequ Context context = new InitialContext(); // Try to lookup the bean - this.productRemoteBean = (AdminProductSessionBeanRemote) context.lookup("ejb/stateless-admin-product"); //NOI18N + this.productRemoteBean = (AdminProductSessionBeanRemote) context.lookup("java:global/jshop-ejb/admin_product, java:global/jshop-ejb/admin_product!org.mxchange.jshopcore.model.product.AdminProductSessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw it again throw new FaceletException(e); diff --git a/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebSessionBean.java index 662d4f8e..5ed9f623 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebSessionBean.java @@ -58,7 +58,7 @@ public class PizzaReceiptWebSessionBean implements PizzaReceiptWebSessionControl Context context = new InitialContext(); // Get factory from JMS resource - this.receiptBean = (ReceiptBeanRemote) context.lookup("ejb/stateless-receipt"); + this.receiptBean = (ReceiptBeanRemote) context.lookup("java:global/jshop-ejb/pdf!org.mxchange.jshopcore.model.receipt.ReceiptBeanRemote"); } catch (final NamingException e) { // Continued to throw throw new FacesException(e); diff --git a/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java index f0e53330..217fbbdd 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java @@ -104,13 +104,13 @@ public class PizzaShopWebApplicationBean implements PizzaShopWebApplicationContr Context context = new InitialContext(); // Try to lookup the bean - CategorySessionBeanRemote categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N + CategorySessionBeanRemote categoryBean = (CategorySessionBeanRemote) context.lookup("java:global/jshop-ejb/category, java:global/jshop-ejb/category!org.mxchange.jshopcore.model.category.CategorySessionBeanRemote"); //NOI18N // Get all categories this.categories = categoryBean.getAllCategories(); // Try to lookup the bean - ProductSessionBeanRemote productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N + ProductSessionBeanRemote productBean = (ProductSessionBeanRemote) context.lookup("java:global/jshop-ejb/product!org.mxchange.jshopcore.model.product.ProductSessionBeanRemote"); //NOI18N // Get available products list this.availableProducts = productBean.getAvailableProducts(); diff --git a/src/java/org/mxchange/pizzaapplication/servlet/receipt/PizzaPdfReceiptServlet.java b/src/java/org/mxchange/pizzaapplication/servlet/receipt/PizzaPdfReceiptServlet.java index 3d374cdb..464e2241 100644 --- a/src/java/org/mxchange/pizzaapplication/servlet/receipt/PizzaPdfReceiptServlet.java +++ b/src/java/org/mxchange/pizzaapplication/servlet/receipt/PizzaPdfReceiptServlet.java @@ -55,7 +55,7 @@ public class PizzaPdfReceiptServlet extends HttpServlet { Context context = new InitialContext(); // Set instance - this.receiptBean = (ReceiptBeanRemote) context.lookup("ejb/pdf-receipt"); //NOI18N + this.receiptBean = (ReceiptBeanRemote) context.lookup("java:global/jshop-ejb/pdf!org.mxchange.jshopcore.model.receipt.ReceiptBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e);