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