/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }