From 9582586043e4db3aca89297e03ab43740f9c104f Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Sun, 12 May 2013 04:32:03 +0200 Subject: [PATCH] removed debug create jms tables --- .../valesriegler/DEBUG_JMSCreateTable.java | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/main/java/at/ac/tuwien/sbc/valesriegler/DEBUG_JMSCreateTable.java diff --git a/src/main/java/at/ac/tuwien/sbc/valesriegler/DEBUG_JMSCreateTable.java b/src/main/java/at/ac/tuwien/sbc/valesriegler/DEBUG_JMSCreateTable.java deleted file mode 100644 index 7adb57e..0000000 --- a/src/main/java/at/ac/tuwien/sbc/valesriegler/DEBUG_JMSCreateTable.java +++ /dev/null @@ -1,75 +0,0 @@ -package at.ac.tuwien.sbc.valesriegler; - -import javax.jms.Connection; -import javax.jms.DeliveryMode; -import javax.jms.MessageProducer; -import javax.jms.Session; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.ac.tuwien.sbc.valesriegler.types.PizzaType; -import at.ac.tuwien.sbc.valesriegler.types.Table; - -/** - * a helper to generate Tables. - * - * @author jan - * - */ -public class DEBUG_JMSCreateTable { - private static final Logger log = LoggerFactory.getLogger(DEBUG_JMSCreateTable.class); - private static int nextID = 0; - final private int id; - - public static void main(String[] args) throws Exception { - new DEBUG_JMSCreateTable(++nextID); - } - - public DEBUG_JMSCreateTable(int id) { - this.id = id; - log.info("I AM A DEBUG_CreateTable WITH ID {}", this.id); - produce(PizzaType.CARDINALE); - } - - public void produce(PizzaType pizzatype) { - try { - // Connecting to the Broker and to the output queue - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); - Connection connection = connectionFactory.createConnection(); - connection.start(); - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - MessageProducer tableprod = session.createProducer(session.createQueue("TablesFree")); - tableprod.setDeliveryMode(DeliveryMode.NON_PERSISTENT); - - // Create Tables - for (int i = 0; i < 2; i++) { - tableprod.send(session.createObjectMessage(new Table(i))); - } - - // // Create Groups - // for (int i = 0; i < 1; i++) { - // Group g = new Group(); - // g.setId(i); - // g.setSize(4); - // ArrayList p = new ArrayList(); - // p.add(PizzaType.CARDINALE); - // p.add(PizzaType.MARGHERITA); - // p.add(PizzaType.SALAMI); - // p.add(PizzaType.MARGHERITA); - // Order o = new Order(p); - // g.setOrder(o); - // g.goGrabSomeFood(); // start the workflow. - // } - - // Clean up - session.close(); - connection.close(); - } catch (Exception e) { - log.error("Caught: ", e); - e.printStackTrace(); - } - } -} -- 2.43.0