public Locator buildLocator(Configuration configuration, ConfiguredComponent configuredLocator) throws ConfigurationException {
		try {
			ConfiguredComponent rootLocator = null;
			String className = configuredLocator.getClassName();
			if (className == null) {
				rootLocator = configuration.getComponent(configuredLocator.getName());
				className = rootLocator.getClassName();
			}
			Class locatorClass = Class.forName(className);
			Locator locator = (Locator)locatorClass.newInstance();
			if (rootLocator != null) {
				for (String name: rootLocator.getProperties().keySet()) {
					setProperty(locator, name, VariableResolver.resolve(configuration, rootLocator.getProperties().get(name)));
				}
			}
			Map<String, String> properties = configuredLocator.getProperties();
			for (String name : properties.keySet()) {
				setProperty(locator, name, VariableResolver.resolve(configuration, properties.get(name)));
			}
			return locator;
		} catch (ClassNotFoundException e) {
			throw new ConfigurationException("Cannot instantiate " + configuredLocator.getClassName());
		} catch (IllegalAccessException e) {
			throw new ConfigurationException("Cannot instantiate " + configuredLocator.getClassName());
		} catch (InstantiationException e) {
			throw new ConfigurationException("Cannot instantiate " + configuredLocator.getClassName());
		}
	}