]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Updated jshop and added first EJB(-lite?) bean
authorRoland Haeder <roland@mxchange.org>
Fri, 4 Sep 2015 10:00:55 +0000 (12:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 4 Sep 2015 10:00:55 +0000 (12:00 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

PizzaService-ejb/lib/jshop.jar
PizzaService-ejb/nbproject/project.properties
PizzaService-ejb/src/java/org/mxchange/pizzaapplication/beans/data/ShopDataBean.java [new file with mode: 0644]

index f1d74f0903e483a6ef0f3a20492b3791f05058fb..0ba207f13c26a94ceedbe943f8ed3350cacd5521 100644 (file)
Binary files a/PizzaService-ejb/lib/jshop.jar and b/PizzaService-ejb/lib/jshop.jar differ
index dcae3cd9c4df169789374dab7c1e7b58f357c228..0599d14f10866dfa0e81d00290f8e8386997532a 100644 (file)
@@ -57,7 +57,7 @@ javac.classpath=\
     ${file.reference.log4j-core-2.3.jar}:\
     ${file.reference.log4j-web-2.3.jar}
 javac.debug=true
-javac.deprecation=false
+javac.deprecation=true
 javac.processorpath=\
     ${javac.classpath}
 javac.source=1.7
@@ -67,21 +67,22 @@ javac.test.classpath=\
     ${build.classes.dir}
 javac.test.processorpath=${javac.test.classpath}
 javadoc.additionalparam=
-javadoc.author=false
+javadoc.author=true
 javadoc.encoding=${source.encoding}
 javadoc.noindex=false
 javadoc.nonavbar=false
 javadoc.notree=false
 javadoc.preview=true
-javadoc.private=false
+javadoc.private=true
 javadoc.splitindex=true
 javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
+javadoc.version=true
+javadoc.windowtitle=Pizza-Service EJBs
 meta.inf=${source.root}/conf
 meta.inf.excludes=sun-cmp-mappings.xml
 platform.active=default_platform
 project.jshop=../../jshop
+project.license=gpl30
 project.PizzaService-lib=../../PizzaService-lib
 reference.jshop.jar=${project.jshop}/dist/jshop.jar
 reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar
diff --git a/PizzaService-ejb/src/java/org/mxchange/pizzaapplication/beans/data/ShopDataBean.java b/PizzaService-ejb/src/java/org/mxchange/pizzaapplication/beans/data/ShopDataBean.java
new file mode 100644 (file)
index 0000000..0dbf7f5
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans.data;
+
+import java.text.MessageFormat;
+import java.util.LinkedList;
+import java.util.List;
+import javax.ejb.Stateful;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import org.mxchange.jcore.contact.Gender;
+import org.mxchange.jshop.beans.BaseFrameworkBean;
+import org.mxchange.jshop.beans.data.ShopDataBeanRemote;
+
+/**
+ * A bean for static data
+ *
+ * @author Roland Haeder
+ */
+@Named("data")
+@Stateful
+@ApplicationScoped
+public class ShopDataBean extends BaseFrameworkBean implements ShopDataBeanRemote {
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 54163294941857L;
+
+       @Override
+       public List<Gender> selectableGenders () {
+               // Trace message
+               this.getLogger().trace("CALLED!"); //NOI18N
+
+               // Init list
+               List<Gender> list = new LinkedList<>();
+
+               // Walk through all genders
+               for (final Gender gender : Gender.values()) {
+                       // Debug log
+                       this.getLogger().debug(MessageFormat.format("gender={0}", gender)); //NOI18N
+
+                       // Is it not UNKNOWN
+                       if (!gender.equals(Gender.UNKNOWN)) {
+                               // Add it
+                               boolean added = list.add(gender);
+
+                               // Has it been added?
+                               assert(added) : MessageFormat.format("gender {0} not added.", gender); //NOI18N
+                       }
+               }
+
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("list={0} - EXIT!", list)); //NOI18N
+
+               // Return it
+               return list;
+       }
+}