added extension mechanism: call applicationStarted() and applicationStopped()

on every active extension (list specified by helma.main.Server).
This commit is contained in:
stefanp 2002-06-08 19:54:49 +00:00
parent 8eabb419d5
commit ec40bec475

View file

@ -5,6 +5,8 @@ package helma.framework.core;
import helma.doc.DocApplication;
import helma.doc.DocException;
import helma.extensions.HelmaExtension;
import helma.extensions.ConfigurationException;
import helma.framework.*;
import helma.main.Server;
import helma.scripting.*;
@ -225,6 +227,16 @@ public final class Application extends UnicastRemoteObject implements IRemoteApp
// scriptingEngine = new helma.scripting.fesi.FesiScriptingEnvironment ();
// scriptingEngine.init (this, props);
Vector extensions = Server.getServer ().getExtensions ();
for (int i=0; i<extensions.size(); i++) {
HelmaExtension ext = (HelmaExtension)extensions.get(i);
try {
ext.applicationStarted (this);
} catch (ConfigurationException e) {
logEvent ("couldn't init extension " + ext.getName () + ": " + e.toString ());
}
}
typemgr = new TypeManager (this);
typemgr.createPrototypes ();
// logEvent ("Started type manager for "+name);
@ -316,6 +328,13 @@ public final class Application extends UnicastRemoteObject implements IRemoteApp
// null out type manager
typemgr = null;
// tell the extensions that we're stopped.
Vector extensions = Server.getServer ().getExtensions ();
for (int i=0; i<extensions.size(); i++) {
HelmaExtension ext = (HelmaExtension)extensions.get(i);
ext.applicationStopped (this);
}
// stop logs if they exist
if (eventLog != null) {
eventLog.close ();