* @since 0.6
*/
public RemoteServiceReference[] connect(final URI uri)
throws RemoteOSGiException, IOException {
final URI endpoint = URI.create(getChannelURI(uri));
final ChannelEndpointImpl test = (ChannelEndpointImpl) channels
.get(endpoint.toString());
if (test != null) {
test.usageCounter++;
return test.getAllRemoteReferences(null);
}
final ChannelEndpointImpl channel;
final String protocol = endpoint.getScheme();
final NetworkChannelFactory factory = getNetworkChannelFactory(protocol);
channel = new ChannelEndpointImpl(factory, endpoint);
return channel.sendLease(getServices(), getTopics());