From 1145bff92e91c5908fcd7a56e0bba5a9c50c4f3b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 15 Oct 2015 11:33:34 +0200 Subject: [PATCH] =?utf8?q?a=20bit=20formatted=20Signed-off-by:Roland=20H?= =?utf8?q?=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../pizzaapplication/beans/checkout/CheckoutWebBean.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); } -- 2.39.5