Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 18 package org.apache.activemq.usecases; 19 20 import javax.jms.Connection ; 21 import javax.jms.Destination ; 22 import javax.jms.MessageConsumer ; 23 import javax.jms.MessageProducer ; 24 import javax.jms.Session ; 25 26 27 33 public class ProducerConsumerTestSupport extends TestSupport { 34 protected Connection connection; 35 protected Session session; 36 protected MessageProducer producer; 37 protected MessageConsumer consumer; 38 protected Destination destination; 39 40 protected void setUp() throws Exception { 41 super.setUp(); 42 connection = createConnection(); 43 session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); 44 destination = this.createDestination(getSubject()); 45 producer = session.createProducer(destination); 46 consumer = session.createConsumer(destination); 47 connection.start(); 48 } 49 50 protected void tearDown() throws Exception { 51 consumer.close(); 52 producer.close(); 53 session.close(); 54 connection.close(); 55 super.tearDown(); 56 } 57 } 58
| Popular Tags
|