}
if (registryURI.startsWith("tuscany:")) {
registryURI = "tuscanyclient:" + registryURI.substring(8);
}
EndpointRegistry endpointRegistry;
try {
endpointRegistry = domainRegistryFactory.getEndpointRegistry(registryURI, domainURI);
} catch (Exception e) {
throw new NoSuchDomainException(domainURI, e);
}
FactoryExtensionPoint factories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
ProxyFactory proxyFactory = new ExtensibleProxyFactory(extensionsRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class));
String client = "sca.client." + UUID.randomUUID();
CompositeContext compositeContext =
new CompositeContext(extensionsRegistry, endpointRegistry, null, domainURI.toString(), client, nodeFactory.getDeployer().getSystemDefinitions());
List<Endpoint> eps = endpointRegistry.findEndpoint(serviceName);
if (eps == null || eps.size() < 1) {
throw new NoSuchServiceException(serviceName);
}
Endpoint endpoint = eps.get(0); // TODO: what should be done with multiple endpoints?