1 18 package org.apache.activemq.transport.discovery.rendezvous; 19 20 import java.io.IOException ; 21 import java.net.URI ; 22 import java.util.Map ; 23 24 import org.apache.activemq.transport.discovery.DiscoveryAgent; 25 import org.apache.activemq.transport.discovery.DiscoveryAgentFactory; 26 import org.apache.activemq.util.IOExceptionSupport; 27 import org.apache.activemq.util.IntrospectionSupport; 28 import org.apache.activemq.util.URISupport; 29 30 public class RendezvousDiscoveryAgentFactory extends DiscoveryAgentFactory { 31 32 protected DiscoveryAgent doCreateDiscoveryAgent(URI uri) throws IOException { 33 try { 34 Map options = URISupport.parseParamters(uri); 35 RendezvousDiscoveryAgent rc = new RendezvousDiscoveryAgent(); 36 rc.setGroup(uri.getHost()); 37 IntrospectionSupport.setProperties(rc, options); 38 return rc; 39 40 } catch (Throwable e) { 41 throw IOExceptionSupport.create("Could not create discovery agent: " + uri, e); 42 } 43 } 44 } 45 | Popular Tags |