From 61926bd69a774215c732317c361b4034841042be Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 18 Oct 2001 13:08:36 +0000 Subject: [PATCH] Remember xml-rpc handler name under which an application has been registered so we can remove it once the application is shut down. --- src/helma/framework/core/Application.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 0f038cb9..8820383f 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -29,8 +29,6 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep SystemProperties props, dbProps; File home, appDir, dbDir; protected NodeManager nmgr; - protected static WebServer xmlrpc; - protected XmlRpcAccess xmlrpcAccess; // the class name of the scripting environment implementation static final String scriptEnvironmentName = "helma.scripting.fesi.Environment"; @@ -76,7 +74,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep // Two logs for each application: events and accesses Logger eventLog, accessLog; - + protected String templateExtension, scriptExtension, actionExtension, skinExtension; // A transient node that is shared among all evaluators @@ -85,6 +83,10 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep protected volatile long xmlrpcCount = 0; protected volatile long errorCount = 0; + protected static WebServer xmlrpc; + protected XmlRpcAccess xmlrpcAccess; + private String xmlrpcHandlerName; + // the URL-prefix to use for links into this application private String baseURI; @@ -245,7 +247,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep nmgr = new NodeManager (this, dbDir.getAbsolutePath (), props); - String xmlrpcHandlerName = props.getProperty ("xmlrpcHandlerName", this.name); + xmlrpcHandlerName = props.getProperty ("xmlrpcHandlerName", this.name); if (xmlrpc != null) xmlrpc.addHandler (xmlrpcHandlerName, new XmlRpcInvoker (this)); @@ -274,7 +276,8 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep worker.interrupt (); worker = null; - xmlrpc.removeHandler (this.name); + if (xmlrpc != null && xmlrpcHandlerName != null) + xmlrpc.removeHandler (xmlrpcHandlerName); // stop evaluators if (allThreads != null) {