]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java
Please cherry-pick:
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / country / PizzaCountryWebApplicationBean.java
index 027076131d3dd518ec859c340e847e98047a0974..c95c39c311c0147741225b16ba445d15b903653c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -17,7 +17,6 @@
 package org.mxchange.pizzaapplication.beans.country;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -29,13 +28,13 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
-import org.mxchange.jcountry.events.AdminAddedCountryEvent;
+import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A country bean
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("countryController")
 @ApplicationScoped
@@ -73,8 +72,13 @@ public class PizzaCountryWebApplicationBean extends BasePizzaController implemen
                }
        }
 
-       @Override
-       public void afterAdminAddedCountry (@Observes final AdminAddedCountryEvent event) {
+       /**
+        * Observing method when the event is fired that an administrator added a
+        * new country
+        * <p>
+        * @param event Event instance
+        */
+       public void afterAdminAddedCountryEvent (@Observes final ObservableAdminAddedCountryEvent event) {
                // Is all valid?
                if (null == event) {
                        // Throw NPE
@@ -95,14 +99,10 @@ public class PizzaCountryWebApplicationBean extends BasePizzaController implemen
        }
 
        @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<Country> allCountries () {
                // Return "cached" version
-               return Collections.unmodifiableList(this.countryList);
-       }
-
-       @Override
-       public boolean hasCountries () {
-               return (!this.countryList.isEmpty());
+               return this.countryList;
        }
 
        /**