@Override
public void bind(final ResourceAddress address,
IoHandler handler,
BridgeSessionInitializer<? extends IoFuture> initializer) throws NioBindException {
boolean useMCP = false;
try {
String uri = address.getExternalURI();
InetAddress inet = InetAddress.getByName(URIUtils.getHost(uri));
if (inet.isMulticastAddress()) {
useMCP = true;
}
} catch (Exception e) {
}
if (useMCP) {
MulticastAcceptor acceptor = new MulticastAcceptor();
acceptor.setConfiguration(new Properties());
acceptor.setResourceAddressFactory(resourceAddressFactory);
acceptor.setBridgeServiceFactory(bridgeServiceFactory);
acceptor.bind(address, handler, initializer);
} else {
super.bind(address, handler, initializer);
}
}