1 18 package org.apache.activemq.transport.multicast; 19 20 import java.net.URI ; 21 22 import org.apache.activemq.openwire.OpenWireFormat; 23 import org.apache.activemq.transport.CommandJoiner; 24 import org.apache.activemq.transport.Transport; 25 import org.apache.activemq.transport.udp.UdpTransportTest; 26 import org.apache.activemq.util.IntSequenceGenerator; 27 import org.apache.commons.logging.Log; 28 import org.apache.commons.logging.LogFactory; 29 30 34 public class MulticastTransportTest extends UdpTransportTest { 35 36 protected static final Log log = LogFactory.getLog(MulticastTransportTest.class); 37 38 private String multicastURI = "multicast://224.1.2.3:6255"; 39 40 41 protected Transport createProducer() throws Exception { 42 log.info("Producer using URI: " + multicastURI); 43 44 48 OpenWireFormat wireFormat = createWireFormat(); 49 MulticastTransport transport = new MulticastTransport(wireFormat, new URI (multicastURI)); 50 transport.setLoopBackMode(false); 51 transport.setSequenceGenerator(new IntSequenceGenerator()); 52 return new CommandJoiner(transport, wireFormat); 53 } 54 55 protected Transport createConsumer() throws Exception { 56 OpenWireFormat wireFormat = createWireFormat(); 57 MulticastTransport transport = new MulticastTransport(wireFormat, new URI (multicastURI)); 58 transport.setLoopBackMode(false); 59 transport.setSequenceGenerator(new IntSequenceGenerator()); 60 return new CommandJoiner(transport, wireFormat); 61 } 62 63 64 } 65 | Popular Tags |