]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
added jcountry-core + jcountry-lib + singleton bean for country data retrieval
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 07:08:12 +0000 (09:08 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 07:08:12 +0000 (09:08 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

PizzaService-ejb/lib/jcountry-core.jar [new file with mode: 0644]
PizzaService-ejb/lib/jcountry-lib.jar [new file with mode: 0644]
PizzaService-ejb/nbproject/build-impl.xml
PizzaService-ejb/nbproject/genfiles.properties
PizzaService-ejb/nbproject/project.properties
PizzaService-ejb/nbproject/project.xml
PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java [new file with mode: 0644]

diff --git a/PizzaService-ejb/lib/jcountry-core.jar b/PizzaService-ejb/lib/jcountry-core.jar
new file mode 100644 (file)
index 0000000..7b77495
Binary files /dev/null and b/PizzaService-ejb/lib/jcountry-core.jar differ
diff --git a/PizzaService-ejb/lib/jcountry-lib.jar b/PizzaService-ejb/lib/jcountry-lib.jar
new file mode 100644 (file)
index 0000000..f917c1d
Binary files /dev/null and b/PizzaService-ejb/lib/jcountry-lib.jar differ
index 59e452317c1919e7718305c6794cabf4efc52f69..79e5a2842e6d7a65e04d2d7e55ff1d8e205d4508 100644 (file)
@@ -828,6 +828,8 @@ exists or setup the property manually. For example like this:
     <target if="is.jars.in.ejbjar" name="-library-inclusion-in-archive-by-user">
         <copyfiles files="${file.reference.jcoreee.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${file.reference.jcore-logger-lib.jar}" todir="${build.classes.dir}"/>
+        <copyfiles files="${file.reference.jcountry-core.jar}" todir="${build.classes.dir}"/>
+        <copyfiles files="${file.reference.jcountry-lib.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${file.reference.jshop-core.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${file.reference.jshop-ee-lib.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${reference.PizzaService-lib.jar}" todir="${build.classes.dir}"/>
@@ -836,23 +838,29 @@ exists or setup the property manually. For example like this:
     <target if="is.server.weblogic" name="-library-inclusion-in-archive-weblogic">
         <basename file="${file.reference.jcoreee.jar}" property="manifest.file.reference.jcoreee.jar"/>
         <basename file="${file.reference.jcore-logger-lib.jar}" property="manifest.file.reference.jcore-logger-lib.jar"/>
+        <basename file="${file.reference.jcountry-core.jar}" property="manifest.file.reference.jcountry-core.jar"/>
+        <basename file="${file.reference.jcountry-lib.jar}" property="manifest.file.reference.jcountry-lib.jar"/>
         <basename file="${file.reference.jshop-core.jar}" property="manifest.file.reference.jshop-core.jar"/>
         <basename file="${file.reference.jshop-ee-lib.jar}" property="manifest.file.reference.jshop-ee-lib.jar"/>
         <basename file="${reference.PizzaService-lib.jar}" property="manifest.reference.PizzaService-lib.jar"/>
         <basename file="${file.reference.cdi-api.jar}" property="manifest.file.reference.cdi-api.jar"/>
         <manifest file="${build.ear.classes.dir}/META-INF/MANIFEST.MF" mode="update">
-            <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 "/>
+            <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 jar-7 jar-8 "/>
             <attribute name="jar-1-Extension-Name" value="${manifest.file.reference.jcoreee.jar}"/>
             <attribute name="jar-2-Extension-Name" value="${manifest.file.reference.jcore-logger-lib.jar}"/>
-            <attribute name="jar-3-Extension-Name" value="${manifest.file.reference.jshop-core.jar}"/>
-            <attribute name="jar-4-Extension-Name" value="${manifest.file.reference.jshop-ee-lib.jar}"/>
-            <attribute name="jar-5-Extension-Name" value="${manifest.reference.PizzaService-lib.jar}"/>
-            <attribute name="jar-6-Extension-Name" value="${manifest.file.reference.cdi-api.jar}"/>
+            <attribute name="jar-3-Extension-Name" value="${manifest.file.reference.jcountry-core.jar}"/>
+            <attribute name="jar-4-Extension-Name" value="${manifest.file.reference.jcountry-lib.jar}"/>
+            <attribute name="jar-5-Extension-Name" value="${manifest.file.reference.jshop-core.jar}"/>
+            <attribute name="jar-6-Extension-Name" value="${manifest.file.reference.jshop-ee-lib.jar}"/>
+            <attribute name="jar-7-Extension-Name" value="${manifest.reference.PizzaService-lib.jar}"/>
+            <attribute name="jar-8-Extension-Name" value="${manifest.file.reference.cdi-api.jar}"/>
         </manifest>
     </target>
     <target depends="compile" name="library-inclusion-in-manifest">
         <copyfiles files="${file.reference.jcoreee.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.jcore-logger-lib.jar}" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jcountry-core.jar}" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jcountry-lib.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.jshop-core.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.jshop-ee-lib.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${reference.PizzaService-lib.jar}" todir="${dist.ear.dir}/lib"/>
index a8b312c200df39b7a112c9d0205623363ebd73a0..084f710655761b93f378d40fe65e86ee7199dfd0 100644 (file)
@@ -3,6 +3,6 @@ build.xml.script.CRC32=cabe2e92
 build.xml.stylesheet.CRC32=5910fda3@1.51.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=8a7af502
-nbproject/build-impl.xml.script.CRC32=d1bf7afb
+nbproject/build-impl.xml.data.CRC32=b7f399f9
+nbproject/build-impl.xml.script.CRC32=dcb101ec
 nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.51.1
index eebe2f6211dded65e9cdde7547cd689e2aeae123..347c750e701bac4120d8bd451803f696bd7a4bd5 100644 (file)
@@ -23,13 +23,15 @@ excludes=
 file.reference.cdi-api.jar=lib/cdi-api.jar
 file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar
 file.reference.jcoreee.jar=lib/jcoreee.jar
+file.reference.jcountry-core.jar=lib/jcountry-core.jar
+file.reference.jcountry-lib.jar=lib/jcountry-lib.jar
 file.reference.jshop-core.jar=lib/jshop-core.jar
 file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.jar
 includes=**
 j2ee.compile.on.save=true
 j2ee.deploy.on.save=true
 j2ee.platform=1.7
-j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
+j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar
 j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
 j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
 j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar
@@ -42,6 +44,8 @@ jars.in.ejbjar=true
 javac.classpath=\
     ${file.reference.jcoreee.jar}:\
     ${file.reference.jcore-logger-lib.jar}:\
+    ${file.reference.jcountry-core.jar}:\
+    ${file.reference.jcountry-lib.jar}:\
     ${file.reference.jshop-core.jar}:\
     ${file.reference.jshop-ee-lib.jar}:\
     ${reference.PizzaService-lib.jar}:\
@@ -85,6 +89,8 @@ runmain.jvmargs=
 source.encoding=UTF-8
 source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/
 source.reference.jcoreee.jar=../../jcoreee/src/
+source.reference.jcountry-core.jar=../jcountry-core/src/
+source.reference.jcountry-lib.jar=../jcountry-lib/src/
 source.reference.jshop-core.jar=../../jshop-core/src/
 source.reference.jshop-ee-lib.jar=../../jshop-ee-lib/src/
 source.root=src
index e6cfa66d45d6c30d4d14ce2b59df6e069a0a9fe8..aec4efad608bb6a3887060314e4566ec6a3ba730 100644 (file)
@@ -1,35 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://www.netbeans.org/ns/project/1">
-       <type>org.netbeans.modules.j2ee.ejbjarproject</type>
-       <configuration>
-               <data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
-                       <name>PizzaService-ejb</name>
-                       <minimum-ant-version>1.6.5</minimum-ant-version>
-                       <included-library dirs="200">file.reference.jcoreee.jar</included-library>
-                       <included-library dirs="200">file.reference.jcore-logger-lib.jar</included-library>
-                       <included-library dirs="200">file.reference.jshop-core.jar</included-library>
-                       <included-library dirs="200">file.reference.jshop-ee-lib.jar</included-library>
-                       <included-library dirs="200">reference.PizzaService-lib.jar</included-library>
-                       <included-library dirs="200">file.reference.cdi-api.jar</included-library>
-                       <source-roots>
-                               <root id="src.dir"/>
-                       </source-roots>
-                       <test-roots>
-                               <root id="test.src.dir"/>
-                       </test-roots>
-               </data>
-               <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
-                       <definitions>lib/nblibraries.properties</definitions>
-               </libraries>
-               <references xmlns="http://www.netbeans.org/ns/ant-project-references/2">
-                       <reference>
-                               <foreign-project>PizzaService-lib</foreign-project>
-                               <artifact-type>jar</artifact-type>
-                               <script>${project.PizzaService-lib}/build.xml</script>
-                               <target>jar</target>
-                               <clean-target>clean</clean-target>
-                               <id>jar</id>
-                       </reference>
-               </references>
-       </configuration>
+    <type>org.netbeans.modules.j2ee.ejbjarproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
+            <name>PizzaService-ejb</name>
+            <minimum-ant-version>1.6.5</minimum-ant-version>
+            <included-library dirs="200">file.reference.jcoreee.jar</included-library>
+            <included-library dirs="200">file.reference.jcore-logger-lib.jar</included-library>
+            <included-library dirs="200">file.reference.jcountry-core.jar</included-library>
+            <included-library dirs="200">file.reference.jcountry-lib.jar</included-library>
+            <included-library dirs="200">file.reference.jshop-core.jar</included-library>
+            <included-library dirs="200">file.reference.jshop-ee-lib.jar</included-library>
+            <included-library dirs="200">reference.PizzaService-lib.jar</included-library>
+            <included-library dirs="200">file.reference.cdi-api.jar</included-library>
+            <source-roots>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
+            <definitions>lib/nblibraries.properties</definitions>
+        </libraries>
+        <references xmlns="http://www.netbeans.org/ns/ant-project-references/2">
+            <reference>
+                <foreign-project>PizzaService-lib</foreign-project>
+                <artifact-type>jar</artifact-type>
+                <script>${project.PizzaService-lib}/build.xml</script>
+                <target>jar</target>
+                <clean-target>clean</clean-target>
+                <id>jar</id>
+            </reference>
+        </references>
+    </configuration>
 </project>
diff --git a/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java b/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java
new file mode 100644 (file)
index 0000000..cabd1f4
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.jcountry.data;
+
+import java.util.List;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.persistence.Query;
+import org.mxchange.jcoreee.database.BaseDatabaseBean;
+
+/**
+ * A singleton bean for country informations
+ * <p>
+ * @author Roland Haeder
+ */
+@Startup
+@Singleton (name = "country", mappedName = "ejb/pizzaservice-singleton-country", description = "A singleton session bean for country informations")
+public class PizzaServiceCountrySingletonBean extends BaseDatabaseBean implements CountrySingletonBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 15_846_983_298_691_207L;
+
+       @Override
+       @SuppressWarnings ("unchecked")
+       public List<Country> allCountries () {
+               // Init query
+               Query query = this.getEntityManager().createNamedQuery("AllCountries"); //NOI18N
+
+               // Return it
+               return query.getResultList();
+       }
+
+}