1 18 package org.apache.activemq.transport.discovery; 19 20 import java.io.IOException ; 21 import java.net.URI ; 22 import java.util.HashMap ; 23 import java.util.Map ; 24 25 import org.apache.activemq.transport.Transport; 26 import org.apache.activemq.transport.TransportServer; 27 import org.apache.activemq.transport.failover.FailoverTransportFactory; 28 import org.apache.activemq.util.IntrospectionSupport; 29 import org.apache.activemq.util.URISupport.CompositeData; 30 31 34 public class DiscoveryTransportFactory extends FailoverTransportFactory { 35 36 public Transport createTransport(CompositeData compositData) throws IOException { 37 Map parameters = new HashMap (compositData.getParameters()); 38 DiscoveryTransport transport = new DiscoveryTransport(createTransport(parameters)); 39 40 DiscoveryAgent discoveryAgent = DiscoveryAgentFactory.createDiscoveryAgent(compositData.getComponents()[0]); 41 transport.setDiscoveryAgent(discoveryAgent); 42 IntrospectionSupport.setProperties(transport,parameters); 43 44 return transport; 45 } 46 47 public TransportServer doBind(String brokerId,URI location) throws IOException { 48 throw new IOException ("Invalid server URI: "+location); 49 } 77 78 } 79 | Popular Tags |