use of jmri.spi.JsonServiceFactory in project JMRI by JMRI.
the class JsonServlet method init.
@Override
public void init() throws ServletException {
super.init();
this.mapper = new ObjectMapper();
for (JsonServiceFactory factory : ServiceLoader.load(JsonServiceFactory.class)) {
JsonHttpService service = factory.getHttpService(this.mapper);
if (service != null) {
for (String type : factory.getTypes()) {
HashSet<JsonHttpService> set = this.services.get(type);
if (set == null) {
this.services.put(type, new HashSet<>());
set = this.services.get(type);
}
set.add(factory.getHttpService(this.mapper));
}
}
}
}
Aggregations