removed FESI dependencies from Application.
This commit is contained in:
parent
c564b4e55b
commit
254a9d50f5
2 changed files with 16 additions and 14 deletions
|
@ -13,8 +13,6 @@ import helma.objectmodel.*;
|
||||||
import helma.objectmodel.db.*;
|
import helma.objectmodel.db.*;
|
||||||
import helma.xmlrpc.*;
|
import helma.xmlrpc.*;
|
||||||
import helma.util.*;
|
import helma.util.*;
|
||||||
import FESI.Data.*;
|
|
||||||
import FESI.Interpreter.*;
|
|
||||||
import com.sleepycat.db.DbException;
|
import com.sleepycat.db.DbException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -33,6 +31,10 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
|
||||||
protected static WebServer xmlrpc;
|
protected static WebServer xmlrpc;
|
||||||
protected XmlRpcAccess xmlrpcAccess;
|
protected XmlRpcAccess xmlrpcAccess;
|
||||||
|
|
||||||
|
// the class name of the scripting environment implementation
|
||||||
|
static final String scriptEnvironmentName = "helma.scripting.fesi.Environment";
|
||||||
|
|
||||||
|
|
||||||
private String baseURI;
|
private String baseURI;
|
||||||
|
|
||||||
public TypeManager typemgr;
|
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
|
// as first thing, invoke function onStart in the root object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
eval.invokeFunction ((INode) null, "onStart", new ESValue[0]);
|
eval.invokeFunction ((INode) null, "onStart", new Object[0]);
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception ignore) {}
|
||||||
|
|
||||||
while (Thread.currentThread () == worker) {
|
while (Thread.currentThread () == worker) {
|
||||||
|
@ -734,7 +736,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
|
||||||
if (now - u.lastTouched () > sessionTimeout * 60000) {
|
if (now - u.lastTouched () > sessionTimeout * 60000) {
|
||||||
if (u.uid != null) {
|
if (u.uid != null) {
|
||||||
try {
|
try {
|
||||||
eval.invokeFunction (u, "onLogout", new ESValue[0]);
|
eval.invokeFunction (u, "onLogout", new Object[0]);
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
ignore.printStackTrace ();
|
ignore.printStackTrace ();
|
||||||
}
|
}
|
||||||
|
@ -753,12 +755,12 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IRep
|
||||||
// check if we should call scheduler
|
// check if we should call scheduler
|
||||||
if (now - lastScheduler > scheduleSleep) {
|
if (now - lastScheduler > scheduleSleep) {
|
||||||
lastScheduler = now;
|
lastScheduler = now;
|
||||||
ESValue val = null;
|
Object val = null;
|
||||||
try {
|
try {
|
||||||
val = eval.invokeFunction ((INode) null, "scheduler", new ESValue[0]);
|
val = eval.invokeFunction ((INode) null, "scheduler", new Object[0]);
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception ignore) {}
|
||||||
try {
|
try {
|
||||||
int ret = val.toInt32 ();
|
int ret = ((Number) val).intValue ();
|
||||||
if (ret < 1000)
|
if (ret < 1000)
|
||||||
scheduleSleep = 60000l;
|
scheduleSleep = 60000l;
|
||||||
else
|
else
|
||||||
|
|
|
@ -652,7 +652,7 @@ public class RequestEvaluator implements Runnable {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized ESValue invokeFunction (IPathElement node, String functionName, ESValue[] args)
|
public synchronized Object invokeFunction (IPathElement node, String functionName, Object[] args)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ESObject obj = null;
|
ESObject obj = null;
|
||||||
if (node == null)
|
if (node == null)
|
||||||
|
@ -662,13 +662,13 @@ public class RequestEvaluator implements Runnable {
|
||||||
return invokeFunction (obj, functionName, args);
|
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 {
|
throws Exception {
|
||||||
this.reqtype = INTERNAL;
|
this.reqtype = INTERNAL;
|
||||||
this.user = null;
|
this.user = null;
|
||||||
this.current = obj;
|
this.current = obj;
|
||||||
this.method = functionName;
|
this.method = functionName;
|
||||||
this.esargs = args;
|
this.esargs = new ESValue[0];
|
||||||
this.res = new ResponseTrans ();
|
this.res = new ResponseTrans ();
|
||||||
esresult = ESNull.theNull;
|
esresult = ESNull.theNull;
|
||||||
exception = null;
|
exception = null;
|
||||||
|
@ -682,16 +682,16 @@ public class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw (exception);
|
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 {
|
throws Exception {
|
||||||
this.reqtype = INTERNAL;
|
this.reqtype = INTERNAL;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.current = null;
|
this.current = null;
|
||||||
this.method = functionName;
|
this.method = functionName;
|
||||||
this.esargs = args;
|
this.esargs = new ESValue[0];
|
||||||
this.res = new ResponseTrans ();
|
this.res = new ResponseTrans ();
|
||||||
esresult = ESNull.theNull;
|
esresult = ESNull.theNull;
|
||||||
exception = null;
|
exception = null;
|
||||||
|
@ -705,7 +705,7 @@ public class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw (exception);
|
throw (exception);
|
||||||
return esresult;
|
return esresult == null ? null : esresult.toJavaObject ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue