public Map mapAvailableServices(Class interfase) throws IOException, ClassNotFoundException {
Map services = resourceFinder.mapAvailableProperties(ServerService.class.getName());
for (Iterator iterator = services.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String name = (String) entry.getKey();
Properties properties = (Properties) entry.getValue();
String className = properties.getProperty("className");
if (className == null) {
className = properties.getProperty("classname");
if (className == null) {
className = properties.getProperty("server");
}
}
Class impl = classLoader.loadClass(className);
properties.put(interfase, impl);
String rawProperties = resourceFinder.findString(interfase.getName() + "/" + name);
properties.put(Properties.class, rawProperties);
}
return services;
}
|