try {
Domain entity = habitat.getService(Domain.class);
Dom dom = Dom.unwrap(entity);
ResourcesGenerator resourcesGenerator = new ASMResourcesGenerator(habitat);
resourcesGenerator.generateSingle(dom.document.getRoot().model, dom.document);
resourcesGenerator.endGeneration();
} catch (Exception ex) {
Logger.getLogger(GeneratorResource.class.getName()).log(Level.SEVERE, null, ex);
}
}