* Make getEvaluator() and releaseEvaluator() methods public

* Immediately mark application as running in init()
* Adapt to new signature of NodeManager.init()
This commit is contained in:
hns 2005-03-18 02:08:28 +00:00
parent 9ef4316dd6
commit 127395afdb

View file

@ -272,6 +272,8 @@ public final class Application implements IPathElement, Runnable {
throws DatabaseException, IllegalAccessException, throws DatabaseException, IllegalAccessException,
InstantiationException, ClassNotFoundException { InstantiationException, ClassNotFoundException {
running = true;
// create and init session manager // create and init session manager
String sessionMgrImpl = props.getProperty("sessionManagerImpl", String sessionMgrImpl = props.getProperty("sessionManagerImpl",
"helma.framework.core.SessionManager"); "helma.framework.core.SessionManager");
@ -360,11 +362,10 @@ public final class Application implements IPathElement, Runnable {
// create the node manager // create the node manager
nmgr = new NodeManager(this); nmgr = new NodeManager(this);
nmgr.init(dbDir.getAbsolutePath(), props); nmgr.init(dbDir.getAbsoluteFile(), props);
// 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());
} }
/** /**
@ -373,8 +374,6 @@ public final class Application implements IPathElement, Runnable {
public synchronized void start() { public synchronized void start() {
starttime = System.currentTimeMillis(); starttime = System.currentTimeMillis();
running = true;
worker = new Thread(this, "Worker-" + name); worker = new Thread(this, "Worker-" + name);
worker.setPriority(Thread.NORM_PRIORITY + 1); worker.setPriority(Thread.NORM_PRIORITY + 1);
worker.start(); worker.start();
@ -450,7 +449,7 @@ public final class Application implements IPathElement, Runnable {
/** /**
* Returns a free evaluator to handle a request. * Returns a free evaluator to handle a request.
*/ */
private RequestEvaluator getEvaluator() { public RequestEvaluator getEvaluator() {
if (!running) { if (!running) {
throw new ApplicationStoppedException(); throw new ApplicationStoppedException();
} }
@ -503,7 +502,7 @@ public final class Application implements IPathElement, Runnable {
/** /**
* Returns an evaluator back to the pool when the work is done. * Returns an evaluator back to the pool when the work is done.
*/ */
protected void releaseEvaluator(RequestEvaluator ev) { public void releaseEvaluator(RequestEvaluator ev) {
if (ev != null) { if (ev != null) {
ev.recycle(); ev.recycle();
freeThreads.push(ev); freeThreads.push(ev);