use of jodd.joy.db.AppDao in project jodd by oblac.
the class WebRunner method runWebApp.
/**
* Starts the app web application and {@link #run() runs} user code.
*/
public void runWebApp(Class<? extends WebApplication> webAppClass) {
madvoc = new Madvoc();
madvoc.setWebAppClass(webAppClass);
madvoc.startNewWebApplication(null);
app = madvoc.getWebApplication();
appCore = BeanUtil.declared.getProperty(app, "appCore");
setJtxManager(appCore.getJtxManager());
appDao = appCore.getPetite().getBean(AppDao.class);
petite = appCore.getPetite();
JtxTransaction tx = startRwTx();
try {
System.out.println(StringUtil.repeat('-', 55) + " start");
System.out.println("\n\n");
run();
System.out.println("\n\n");
System.out.println(StringUtil.repeat('-', 55) + " end");
tx.commit();
} catch (Throwable throwable) {
throwable.printStackTrace();
tx.rollback();
}
try {
ReflectUtil.invokeDeclared(app, "destroy", new Class[] { MadvocConfig.class }, new Object[] { null });
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations