From: Roland Haeder Date: Fri, 4 Sep 2015 10:00:55 +0000 (+0200) Subject: Updated jshop and added first EJB(-lite?) bean X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0d420f05908b5273d6334a0d136af98387216046;p=pizzaservice-core.git Updated jshop and added first EJB(-lite?) bean Signed-off-by:Roland Häder --- diff --git a/PizzaService-ejb/lib/jshop.jar b/PizzaService-ejb/lib/jshop.jar index f1d74f0..0ba207f 100644 Binary files a/PizzaService-ejb/lib/jshop.jar and b/PizzaService-ejb/lib/jshop.jar differ diff --git a/PizzaService-ejb/nbproject/project.properties b/PizzaService-ejb/nbproject/project.properties index dcae3cd..0599d14 100644 --- a/PizzaService-ejb/nbproject/project.properties +++ b/PizzaService-ejb/nbproject/project.properties @@ -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 index 0000000..0dbf7f5 --- /dev/null +++ b/PizzaService-ejb/src/java/org/mxchange/pizzaapplication/beans/data/ShopDataBean.java @@ -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 . + */ +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 selectableGenders () { + // Trace message + this.getLogger().trace("CALLED!"); //NOI18N + + // Init list + List 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; + } +}