Move session manager initialization code towards the end of init() to make sure

other fiels are initialized when we start (request evaluators must be usable).
This commit is contained in:
hns 2005-03-18 13:51:54 +00:00
parent 892fe4b6e1
commit c4c3505545

View file

@ -274,17 +274,6 @@ public final class Application implements IPathElement, Runnable {
running = true; running = true;
// create and init session manager
String sessionMgrImpl = props.getProperty("sessionManagerImpl",
"helma.framework.core.SessionManager");
sessionMgr = (SessionManager) Class.forName(sessionMgrImpl).newInstance();
sessionMgr.init(this);
// read the sessions if wanted
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
sessionMgr.loadSessionData(null);
}
// create and init type mananger // create and init type mananger
typemgr = new TypeManager(this); typemgr = new TypeManager(this);
typemgr.createPrototypes(); typemgr.createPrototypes();
@ -364,6 +353,17 @@ public final class Application implements IPathElement, Runnable {
nmgr = new NodeManager(this); nmgr = new NodeManager(this);
nmgr.init(dbDir.getAbsoluteFile(), props); nmgr.init(dbDir.getAbsoluteFile(), props);
// create and init session manager
String sessionMgrImpl = props.getProperty("sessionManagerImpl",
"helma.framework.core.SessionManager");
sessionMgr = (SessionManager) Class.forName(sessionMgrImpl).newInstance();
sessionMgr.init(this);
// read the sessions if wanted
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
sessionMgr.loadSessionData(null);
}
// reset the classloader to the parent/system/server classloader. // reset the classloader to the parent/system/server classloader.
Thread.currentThread().setContextClassLoader(typemgr.getClassLoader().getParent()); Thread.currentThread().setContextClassLoader(typemgr.getClassLoader().getParent());
} }