Check if Server singleton exists before trying to get the list of extensions from it.
(backport from main trunk (helma 1.3))
This commit is contained in:
parent
1e609f3ec6
commit
90439a58d9
2 changed files with 36 additions and 28 deletions
|
@ -259,6 +259,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
*/
|
||||
public void init()
|
||||
throws DatabaseException, ScriptingException, MalformedURLException {
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -271,6 +272,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// read the sessions if wanted
|
||||
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
|
||||
|
@ -377,6 +379,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
typemgr = null;
|
||||
|
||||
// tell the extensions that we're stopped.
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -384,6 +387,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
|
||||
ext.applicationStopped(this);
|
||||
}
|
||||
}
|
||||
|
||||
// store the sessions if wanted
|
||||
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
|
||||
|
@ -1590,6 +1594,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
}
|
||||
|
||||
// update extensions
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -1600,6 +1605,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
} catch (ConfigurationException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set prop read timestamp
|
||||
lastPropertyRead = props.lastModified();
|
||||
|
|
|
@ -116,6 +116,7 @@ public class FesiEngine implements ScriptingEngine {
|
|||
// load extensions defined in server.properties:
|
||||
extensionGlobals = new HashMap();
|
||||
|
||||
if (Server.getServer() != null) {
|
||||
Vector extVec = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extVec.size(); i++) {
|
||||
|
@ -132,6 +133,7 @@ public class FesiEngine implements ScriptingEngine {
|
|||
e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fake a cache member like the one found in ESNodes
|
||||
global.putHiddenProperty("cache", new ESNode(new TransientNode("cache"), this));
|
||||
|
|
Loading…
Add table
Reference in a new issue