applied patch for AMQ-944

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@515556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-03-07 13:04:19 +00:00
parent d57343cdb5
commit 63b82516a4
1 changed files with 14 additions and 0 deletions

View File

@ -26,15 +26,29 @@ import org.apache.activemq.transport.discovery.DiscoveryAgentFactory;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class MulticastDiscoveryAgentFactory extends DiscoveryAgentFactory {
private static final Log log = LogFactory.getLog(MulticastDiscoveryAgentFactory.class);
protected DiscoveryAgent doCreateDiscoveryAgent(URI uri) throws IOException {
try {
Map options = URISupport.parseParamters(uri);
MulticastDiscoveryAgent rc = new MulticastDiscoveryAgent();
rc.setGroup(uri.getHost());
if ("default".equals(uri.getHost())) {
log.info("Using default discovery uri " + uri);
} else {
// only set the discovery URI if a non-default multicast IP/port endpoint is being used.
log.info("Setting discovery uri to " + uri);
rc.setDiscoveryURI(uri);
}
IntrospectionSupport.setProperties(rc, options);
return rc;