//TODO factor localHost and protocol out?
final String localHost = InetAddress.getLocalHost().getCanonicalHostName();
final String protocol = "r-osgi"; //$NON-NLS-1$
final int port = remoteOSGiService.getListeningPort(protocol);
final ID containerID = new R_OSGiID(protocol + "://" + localHost + ":" + port); //$NON-NLS-1$ //$NON-NLS-2$
return new R_OSGiRemoteServiceContainer(remoteOSGiService, containerID);
} else if (parameters.length > 0) {
if (parameters[0] instanceof ID) {
return new R_OSGiRemoteServiceContainer(remoteOSGiService, (ID) parameters[0]);
} else if (parameters[0] instanceof String) {
return new R_OSGiRemoteServiceContainer(remoteOSGiService, new R_OSGiID((String) parameters[0]));
}
}
throw new ContainerCreateException("Unsupported arguments " //$NON-NLS-1$
+ Arrays.asList(parameters));
} catch (IDCreateException e) {