Remember xml-rpc handler name under which an application

has been registered so we can remove it once the application
is shut down.
This commit is contained in:
hns 2001-10-18 13:08:36 +00:00
parent 1334833b14
commit 61926bd69a

View file

@ -29,8 +29,6 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
SystemProperties props, dbProps; SystemProperties props, dbProps;
File home, appDir, dbDir; File home, appDir, dbDir;
protected NodeManager nmgr; protected NodeManager nmgr;
protected static WebServer xmlrpc;
protected XmlRpcAccess xmlrpcAccess;
// the class name of the scripting environment implementation // the class name of the scripting environment implementation
static final String scriptEnvironmentName = "helma.scripting.fesi.Environment"; static final String scriptEnvironmentName = "helma.scripting.fesi.Environment";
@ -85,6 +83,10 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
protected volatile long xmlrpcCount = 0; protected volatile long xmlrpcCount = 0;
protected volatile long errorCount = 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 // the URL-prefix to use for links into this application
private String baseURI; private String baseURI;
@ -245,7 +247,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
nmgr = new NodeManager (this, dbDir.getAbsolutePath (), props); nmgr = new NodeManager (this, dbDir.getAbsolutePath (), props);
String xmlrpcHandlerName = props.getProperty ("xmlrpcHandlerName", this.name); xmlrpcHandlerName = props.getProperty ("xmlrpcHandlerName", this.name);
if (xmlrpc != null) if (xmlrpc != null)
xmlrpc.addHandler (xmlrpcHandlerName, new XmlRpcInvoker (this)); xmlrpc.addHandler (xmlrpcHandlerName, new XmlRpcInvoker (this));
@ -274,7 +276,8 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
worker.interrupt (); worker.interrupt ();
worker = null; worker = null;
xmlrpc.removeHandler (this.name); if (xmlrpc != null && xmlrpcHandlerName != null)
xmlrpc.removeHandler (xmlrpcHandlerName);
// stop evaluators // stop evaluators
if (allThreads != null) { if (allThreads != null) {