Namespace namespace = new Namespace();
namespace.setName(configuration.getAttribute("name"));
namespace.setLogger(namespaceLogger);
Configuration namespaceConfigurationDefinition =
configuration.getConfiguration("configuration");
namespace.loadParameters(namespaceConfigurationDefinition);
Configuration namespaceDefinition =
configuration.getConfiguration("definition");
namespace.loadDefinition(namespaceDefinition);
addNamespace(namespace);
try {
Configuration namespaceBaseDataDefinition =
configuration.getConfiguration("data");
namespace.loadBaseData(namespaceBaseDataDefinition);
} catch (ConfigurationException e) {
info("No basedata found for the namespace");
}
namespace.loadConfiguration(namespaceConfigurationDefinition);
try {
Configuration namespaceExtractorsDefinition =
configuration.getConfiguration("extractors");
namespace.loadExtractors(namespaceExtractorsDefinition);
} catch (ConfigurationException e) {
// ignore
}
// preparation to add services, please ignore now
try {
Configuration services = configuration.getConfiguration("services");
Enumeration s = services.getConfigurations("service");
while (s.hasMoreElements()) {
Configuration service = (Configuration)s.nextElement();
System.out.println("&&&&&&Name = " + service.getName());
System.out.println("&&&&&&className = " + service.getAttribute("classname"));
System.out.println("&&&&&&serviceName = " + service.getAttribute("name"));
Enumeration s_pars = service.getConfigurations("parameter");
while (s_pars.hasMoreElements()) {
Configuration s_par = (Configuration)s_pars.nextElement();
System.out.println("&&&&&&PAR Name = " + s_par.getName());
System.out.println("&&&&&&PAR Name = " + s_par.getAttribute("name"));
System.out.println("&&&&&&Par Val = " + s_par.getValue());
}
}
}
catch (ConfigurationException e){
// silently ignore it ==> no services