Pick up the default scheme from runtime properties

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@936191 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
antelder 2010-04-21 08:06:49 +00:00
parent c7c095e3bb
commit 7046efb30d

View file

@ -37,9 +37,15 @@ import org.oasisopen.sca.ServiceRuntimeException;
public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory {
private final DomainRegistryFactoryExtensionPoint factories;
private String[] allSchemes;
private String defaultScheme = "tuscany";
public ExtensibleDomainRegistryFactory(ExtensionPointRegistry registry) {
this.factories = registry.getExtensionPoint(DomainRegistryFactoryExtensionPoint.class);
RuntimeProperties ps = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class);
if (ps.getProperties().containsKey("defaultScheme")) {
defaultScheme = ps.getProperties().getProperty("defaultScheme");
}
}
public ExtensibleDomainRegistryFactory(DomainRegistryFactoryExtensionPoint factories) {
@ -86,8 +92,8 @@ public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory {
}
}
scheme = "vm";
endpointRegistryURI = "vm:" + endpointRegistryURI;
scheme = defaultScheme;
endpointRegistryURI = scheme + ":" + endpointRegistryURI;
} else {
scheme = scheme.toLowerCase();
}