From: Roland Haeder Date: Thu, 15 Oct 2015 09:33:34 +0000 (+0200) Subject: a bit formatted X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1145bff92e91c5908fcd7a56e0bba5a9c50c4f3b;p=pizzaservice-war.git a bit formatted Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java index dcfafb9c..95b1bf6a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java @@ -78,7 +78,6 @@ public class CheckoutWebBean implements CheckoutWebController { @Inject private CustomerWebController customerController; - /** * Object message */ @@ -94,7 +93,6 @@ public class CheckoutWebBean implements CheckoutWebController { */ private Queue queue; - /** * Receipt bean */ @@ -206,20 +204,25 @@ public class CheckoutWebBean implements CheckoutWebController { try { // Get initial context Context context = new InitialContext(); + // Get factory from JMS resource QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup("jms/shopConnectionFactory"); //NOI18N + // Lookup queue this.queue = (Queue) context.lookup("jms/shopCheckoutQueue"); //NOI18N // Create connection this.connection = connectionFactory.createConnection(); + // Init session instance this.session = this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + // And message producer this.messageProducer = this.session.createProducer(this.queue); + // Finally the message instance itself this.message = this.session.createObjectMessage(); - }catch (final NamingException | JMSException e) { + } catch (final NamingException | JMSException e) { // Continued to throw throw new FacesException(e); }