]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java
also fire an event when a new product has been added, rather than calling addProduct...
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / shop / PizzaShopWebApplicationBean.java
index 4992bfeb84086ff0cd020510ecc7488ea31f81c4..1fbe8458c1ac8971bda1df83fd9a4a05edf1488a 100644 (file)
@@ -29,6 +29,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jshopcore.events.category.AddedCategoryEvent;
+import org.mxchange.jshopcore.events.product.AddedProductEvent;
 import org.mxchange.jshopcore.model.category.Category;
 import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
 import org.mxchange.jshopcore.model.product.Product;
@@ -79,6 +80,12 @@ public class PizzaShopWebApplicationBean implements PizzaShopWebApplicationContr
                this.addCategory(event.getAddedCategory());
        }
 
+       @Override
+       public void afterShopProductAdded (@Observes final AddedProductEvent event) {
+               // Add it here, too.
+               this.addProduct(event.getAddedProduct());
+       }
+
        @Override
        public List<Category> getAllCategories () throws FacesException {
                // Return it