From: Roland Haeder Date: Wed, 27 Apr 2016 19:17:40 +0000 (+0200) Subject: Continued fixing: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=92e6a24a7eef7a1ea5db885b76f1f7027a52b204;p=pizzaservice-ejb.git Continued fixing: - renamed class for own prefix - updated project files as new libs are required - fixed imports --- diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index eb49030..32f3dbc 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -25,8 +25,8 @@ is divided into following sections: - @@ -749,9 +749,9 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f The libs.CopyLibs.classpath property is not set up. -This property must point to +This property must point to org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part -of NetBeans IDE installation and is usually located at +of NetBeans IDE installation and is usually located at <netbeans_installation>/java<version>/ant/extra folder. Either open the project in the IDE and make sure CopyLibs library exists or setup the property manually. For example like this: @@ -835,8 +835,12 @@ exists or setup the property manually. For example like this: + + + + @@ -850,12 +854,16 @@ exists or setup the property manually. For example like this: + + + + - + @@ -865,10 +873,14 @@ exists or setup the property manually. For example like this: - - - - + + + + + + + + @@ -881,8 +893,12 @@ exists or setup the property manually. For example like this: + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 1ed4581..8120b8f 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=9c0f08a9 build.xml.stylesheet.CRC32=5910fda3@1.55.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=be5d8e80 -nbproject/build-impl.xml.script.CRC32=c48d23aa +nbproject/build-impl.xml.data.CRC32=9e5ca144 +nbproject/build-impl.xml.script.CRC32=c2a539b2 nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.55.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index a11d1c0..d110bbe 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -29,6 +29,8 @@ file.reference.jcore.jar=lib/jcore.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.jcustomer-core.jar=lib/jcustomer-core.jar +file.reference.jmailer-ee.jar=lib/jmailer-ee.jar file.reference.jphone-core.jar=lib/jphone-core.jar file.reference.jphone-lib.jar=lib/jphone-lib.jar file.reference.jshop-core.jar=lib/jshop-core.jar @@ -61,10 +63,12 @@ javac.classpath=\ ${file.reference.jcontacts-lib.jar}:\ ${file.reference.juser-core.jar}:\ ${file.reference.juser-lib.jar}:\ + ${file.reference.jcustomer-core.jar}:\ ${file.reference.jphone-core.jar}:\ ${file.reference.jphone-lib.jar}:\ ${file.reference.jshop-core.jar}:\ ${file.reference.jshop-ee-lib.jar}:\ + ${file.reference.jmailer-ee.jar}:\ ${file.reference.pizzaservice-core.jar}:\ ${reference.PizzaService-lib.jar}:\ ${file.reference.cdi-api.jar} @@ -111,6 +115,8 @@ source.reference.jcore.jar=../jcore/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.jcustomer-core.jar=../jcustomer-core/src/ +source.reference.jmailer-ee.jar=../jmailer-ee/src/ source.reference.jphone-core.jar=../jphone-core/src/ source.reference.jphone-lib.jar=../jphone-lib/src/ source.reference.jshop-core.jar=../../jshop-core/src/ diff --git a/nbproject/project.xml b/nbproject/project.xml index cfd140c..855481f 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -14,8 +14,12 @@ file.reference.jcontacts-lib.jar file.reference.juser-core.jar file.reference.juser-lib.jar + file.reference.jcustomer-core.jar file.reference.jphone-core.jar file.reference.jphone-lib.jar + file.reference.jshop-core.jar + file.reference.jshop-ee-lib.jar + file.reference.jmailer-ee.jar file.reference.pizzaservice-core.jar reference.PizzaService-lib.jar diff --git a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java index 2083847..8d3c805 100644 --- a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java @@ -27,9 +27,7 @@ import javax.persistence.Query; import org.mxchange.jcontacts.contact.utils.ContactUtils; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; -import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;; -import org.mxchange.jcontacts.contact.utils.ContactUtils; - +import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** * A contact EJB *

diff --git a/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java index 814e9e9..8756060 100644 --- a/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jcountry.data; -import de.chotime.jratecalc.database.BasePizzaDatabaseBean; import java.text.MessageFormat; import java.util.GregorianCalendar; import java.util.List; diff --git a/src/java/org/mxchange/jmailee/model/delivery/PizzaEmailDeliveryMessageBean.java b/src/java/org/mxchange/jmailee/model/delivery/PizzaEmailDeliveryMessageBean.java new file mode 100644 index 0000000..6db0917 --- /dev/null +++ b/src/java/org/mxchange/jmailee/model/delivery/PizzaEmailDeliveryMessageBean.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jmailee.model.delivery; + +import java.io.Serializable; +import java.text.MessageFormat; +import javax.ejb.ActivationConfigProperty; +import javax.ejb.MessageDriven; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageListener; +import javax.jms.ObjectMessage; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; + +/** + * A message queue for sending out emails + *

+ * @author Roland Haeder + */ +@MessageDriven ( + name = "rateCalcEmail", + description = "A message bean for email delivery", + activationConfig = { + @ActivationConfigProperty (propertyName = "destinationLookup", propertyValue = "jms/pizzaservice-email-queue"), + @ActivationConfigProperty (propertyName = "destinationType", propertyValue = "javax.jms.Queue") + } +) +public class PizzaEmailDeliveryMessageBean implements MessageListener { + + /** + * Logger bean + */ + @Log + private LoggerBeanLocal loggerBeanLocal; + + /** + * Default constructor + */ + public PizzaEmailDeliveryMessageBean () { + try { + // Get initial context + Context context = new InitialContext(); + + // Lookup logger + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + + @Override + public void onMessage (final Message message) { + // Trace message + this.loggerBeanLocal.logTrace(MessageFormat.format("onMessage: message={0} - CALLED!", message)); //NOI18N + + // Is the message castable to ObjectMessage? + if (null == message) { + // message is null + throw new NullPointerException("message is null"); //NOI18N + } else if (!(message instanceof ObjectMessage)) { + // Not castable + throw new ClassCastException(MessageFormat.format("message cannot be casted to ObjectMessage: {0}", message)); //NOI18N + } + + // Securely cast it + ObjectMessage objectMessage = (ObjectMessage) message; + + // Init instance + Serializable object; + + try { + // Get object from it + object = objectMessage.getObject(); + } catch (final JMSException ex) { + // Log exception ... + this.loggerBeanLocal.logException(ex); + + // ... and don't continue + return; + } + + // Debug message + this.loggerBeanLocal.logDebug(MessageFormat.format("onMessage: object={0}", object)); //NOI18N + + // Does this object implement WrapableCheckout ? + if (null == object) { + // object cannot be null + throw new NullPointerException("object is null"); //NOI18N + } else if (!(object instanceof WrapableEmailDelivery)) { + // Not proper interface used + throw new ClassCastException(MessageFormat.format("object does not implement WrapableEmailDelivery: {0}", object)); //NOI18N + } + + // Cast the object to the wrapper interface + WrapableEmailDelivery emailDelivery = (WrapableEmailDelivery) object; + + // Trace message + this.loggerBeanLocal.logTrace("onMessage: EXIT!"); //NOI18N + } + +} diff --git a/src/java/org/mxchange/jmailee/model/delivery/RateCalcEmailDeliveryMessageBean.java b/src/java/org/mxchange/jmailee/model/delivery/RateCalcEmailDeliveryMessageBean.java deleted file mode 100644 index 4c509b0..0000000 --- a/src/java/org/mxchange/jmailee/model/delivery/RateCalcEmailDeliveryMessageBean.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2016 Cho-Time GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package org.mxchange.jmailee.model.delivery; - -import java.io.Serializable; -import java.text.MessageFormat; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.ObjectMessage; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcoreeelogger.beans.local.logger.Log; -import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; - -/** - * A message queue for sending out emails - *

- * @author Roland Haeder - */ -@MessageDriven ( - name = "rateCalcEmail", - description = "A message bean for email delivery", - activationConfig = { - @ActivationConfigProperty (propertyName = "destinationLookup", propertyValue = "jms/jratecalc-email-queue"), - @ActivationConfigProperty (propertyName = "destinationType", propertyValue = "javax.jms.Queue") - } -) -public class RateCalcEmailDeliveryMessageBean implements MessageListener { - - /** - * Logger bean - */ - @Log - private LoggerBeanLocal loggerBeanLocal; - - /** - * Default constructor - */ - public RateCalcEmailDeliveryMessageBean () { - try { - // Get initial context - Context context = new InitialContext(); - - // Lookup logger - this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw - throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } - } - - @Override - public void onMessage (final Message message) { - // Trace message - this.loggerBeanLocal.logTrace(MessageFormat.format("onMessage: message={0} - CALLED!", message)); //NOI18N - - // Is the message castable to ObjectMessage? - if (null == message) { - // message is null - throw new NullPointerException("message is null"); //NOI18N - } else if (!(message instanceof ObjectMessage)) { - // Not castable - throw new ClassCastException(MessageFormat.format("message cannot be casted to ObjectMessage: {0}", message)); //NOI18N - } - - // Securely cast it - ObjectMessage objectMessage = (ObjectMessage) message; - - // Init instance - Serializable object; - - try { - // Get object from it - object = objectMessage.getObject(); - } catch (final JMSException ex) { - // Log exception ... - this.loggerBeanLocal.logException(ex); - - // ... and don't continue - return; - } - - // Debug message - this.loggerBeanLocal.logDebug(MessageFormat.format("onMessage: object={0}", object)); //NOI18N - - // Does this object implement WrapableCheckout ? - if (null == object) { - // object cannot be null - throw new NullPointerException("object is null"); //NOI18N - } else if (!(object instanceof WrapableEmailDelivery)) { - // Not proper interface used - throw new ClassCastException(MessageFormat.format("object does not implement WrapableEmailDelivery: {0}", object)); //NOI18N - } - - // Cast the object to the wrapper interface - WrapableEmailDelivery emailDelivery = (WrapableEmailDelivery) object; - - // Trace message - this.loggerBeanLocal.logTrace("onMessage: EXIT!"); //NOI18N - } - -} diff --git a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/PizzaAdminMobileProviderSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/PizzaAdminMobileProviderSessionBean.java index 153d3c9..25df8fd 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/PizzaAdminMobileProviderSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/PizzaAdminMobileProviderSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jphone.phonenumbers.mobileprovider; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import java.text.MessageFormat; import java.util.GregorianCalendar; import javax.ejb.Stateless; diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminContactPhoneSessionBean.java index 2a06c35..8a04591 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminContactPhoneSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jphone.phonenumbers.phone; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import java.text.MessageFormat; import java.util.List; import javax.ejb.Stateless; diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminPhoneSessionBean.java index eb37c9d..61c3f21 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminPhoneSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaAdminPhoneSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jphone.phonenumbers.phone; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import javax.ejb.Stateless; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java index dfd3def..69df539 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jphone.phonenumbers.phone; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import java.text.MessageFormat; import javax.ejb.Stateless; import javax.persistence.NoResultException; diff --git a/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java b/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java index 15bb461..fe3f856 100644 --- a/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jusercore.model.login; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import java.text.MessageFormat; import javax.ejb.EJB; import javax.ejb.Stateless; diff --git a/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java b/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java index 7dcb5f3..6953910 100644 --- a/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jusercore.model.register; -import de.chotime.jratecalc.database.BaseRateCalcDatabaseBean; import java.text.MessageFormat; import javax.ejb.EJB; import javax.ejb.Stateless; diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java index 2ce8972..2801cbd 100644 --- a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java @@ -26,6 +26,9 @@ import javax.persistence.NoResultException; import javax.persistence.PersistenceException; import javax.persistence.Query; import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; diff --git a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java index 21feee5..109fbfd 100644 --- a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java @@ -54,7 +54,7 @@ public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean impleme * General customer bean */ @EJB - private RateCalcCustomerSessionBeanRemote customerBean; + private PizzaCustomerSessionBeanRemote customerBean; @Override public Customer addCustomer (final Customer customer) throws CustomerAlreadyRegisteredException, ContactAlreadyAddedException {