removed FESI dependencies from Application.

This commit is contained in:
hns 2001-09-06 16:39:12 +00:00
parent c564b4e55b
commit 254a9d50f5
2 changed files with 16 additions and 14 deletions

View file

@ -13,8 +13,6 @@ import helma.objectmodel.*;
import helma.objectmodel.db.*;
import helma.xmlrpc.*;
import helma.util.*;
import FESI.Data.*;
import FESI.Interpreter.*;
import com.sleepycat.db.DbException;
import java.util.*;
@ -33,6 +31,10 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
protected static WebServer xmlrpc;
protected XmlRpcAccess xmlrpcAccess;
// the class name of the scripting environment implementation
static final String scriptEnvironmentName = "helma.scripting.fesi.Environment";
private String baseURI;
public TypeManager typemgr;
@ -712,7 +714,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
// as first thing, invoke function onStart in the root object
try {
eval.invokeFunction ((INode) null, "onStart", new ESValue[0]);
eval.invokeFunction ((INode) null, "onStart", new Object[0]);
} catch (Exception ignore) {}
while (Thread.currentThread () == worker) {
@ -734,7 +736,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
if (now - u.lastTouched () > sessionTimeout * 60000) {
if (u.uid != null) {
try {
eval.invokeFunction (u, "onLogout", new ESValue[0]);
eval.invokeFunction (u, "onLogout", new Object[0]);
} catch (Exception ignore) {
ignore.printStackTrace ();
}
@ -753,12 +755,12 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
// check if we should call scheduler
if (now - lastScheduler > scheduleSleep) {
lastScheduler = now;
ESValue val = null;
Object val = null;
try {
val = eval.invokeFunction ((INode) null, "scheduler", new ESValue[0]);
val = eval.invokeFunction ((INode) null, "scheduler", new Object[0]);
} catch (Exception ignore) {}
try {
int ret = val.toInt32 ();
int ret = ((Number) val).intValue ();
if (ret < 1000)
scheduleSleep = 60000l;
else

View file

@ -652,7 +652,7 @@ public class RequestEvaluator implements Runnable {
return result;
}
public synchronized ESValue invokeFunction (IPathElement node, String functionName, ESValue[] args)
public synchronized Object invokeFunction (IPathElement node, String functionName, Object[] args)
throws Exception {
ESObject obj = null;
if (node == null)
@ -662,13 +662,13 @@ public class RequestEvaluator implements Runnable {
return invokeFunction (obj, functionName, args);
}
public synchronized ESValue invokeFunction (ESObject obj, String functionName, ESValue[] args)
public synchronized Object invokeFunction (ESObject obj, String functionName, Object[] args)
throws Exception {
this.reqtype = INTERNAL;
this.user = null;
this.current = obj;
this.method = functionName;
this.esargs = args;
this.esargs = new ESValue[0];
this.res = new ResponseTrans ();
esresult = ESNull.theNull;
exception = null;
@ -682,16 +682,16 @@ public class RequestEvaluator implements Runnable {
if (exception != null)
throw (exception);
return esresult;
return esresult == null ? null : esresult.toJavaObject ();
}
public synchronized ESValue invokeFunction (User user, String functionName, ESValue[] args)
public synchronized Object invokeFunction (User user, String functionName, Object[] args)
throws Exception {
this.reqtype = INTERNAL;
this.user = user;
this.current = null;
this.method = functionName;
this.esargs = args;
this.esargs = new ESValue[0];
this.res = new ResponseTrans ();
esresult = ESNull.theNull;
exception = null;
@ -705,7 +705,7 @@ public class RequestEvaluator implements Runnable {
if (exception != null)
throw (exception);
return esresult;
return esresult == null ? null : esresult.toJavaObject ();
}