import org.oasisopen.sca.NoSuchDomainException;
public class RuntimeUtils {
public static ExtensionPointRegistry createExtensionPointRegistry() throws NoSuchDomainException {
ExtensionPointRegistry extensionsRegistry = new DefaultExtensionPointRegistry();
extensionsRegistry.start();
FactoryExtensionPoint modelFactories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
RuntimeAssemblyFactory assemblyFactory = new RuntimeAssemblyFactory(extensionsRegistry);
modelFactories.addFactory(assemblyFactory);
UtilityExtensionPoint utilities = extensionsRegistry.getExtensionPoint(UtilityExtensionPoint.class);
Properties domainConfigProps = new Properties();
domainConfigProps.setProperty("client", "true");
utilities.getUtility(RuntimeProperties.class).setProperties(domainConfigProps);
// TODO: is this needed?
utilities.getUtility(WorkScheduler.class);
// Initialize the Tuscany module activators
// The module activators will be started
extensionsRegistry.getExtensionPoint(ModuleActivatorExtensionPoint.class);
return extensionsRegistry;
}