Minor fixes for StandaloneServletClient
This commit is contained in:
parent
e383beaa08
commit
45da518a63
4 changed files with 38 additions and 33 deletions
|
@ -62,32 +62,29 @@ public class TypeManager implements Runnable {
|
||||||
public void check () {
|
public void check () {
|
||||||
// long now = System.currentTimeMillis ();
|
// long now = System.currentTimeMillis ();
|
||||||
// System.out.print ("checking "+Thread.currentThread ());
|
// System.out.print ("checking "+Thread.currentThread ());
|
||||||
try {
|
String[] list = appDir.list ();
|
||||||
String[] list = appDir.list ();
|
if (list == null)
|
||||||
for (int i=0; i<list.length; i++) {
|
throw new RuntimeException ("Can't read app directory "+appDir+" - check permissions");
|
||||||
File protoDir = new File (appDir, list[i]);
|
for (int i=0; i<list.length; i++) {
|
||||||
// cut out ".." and other directories that contain "."
|
File protoDir = new File (appDir, list[i]);
|
||||||
if (isValidTypeName (list[i]) && protoDir.isDirectory ()) {
|
// cut out ".." and other directories that contain "."
|
||||||
Prototype proto = getPrototype (list[i]);
|
if (isValidTypeName (list[i]) && protoDir.isDirectory ()) {
|
||||||
if (proto != null) {
|
Prototype proto = getPrototype (list[i]);
|
||||||
// check if existing prototype needs update
|
if (proto != null) {
|
||||||
// app.logEvent (protoDir.lastModified ());
|
// check if existing prototype needs update
|
||||||
updatePrototype (list[i], protoDir, proto);
|
// app.logEvent (protoDir.lastModified ());
|
||||||
} else {
|
updatePrototype (list[i], protoDir, proto);
|
||||||
// create new prototype
|
} else {
|
||||||
proto = new Prototype (protoDir, app);
|
// create new prototype
|
||||||
registerPrototype (list[i], protoDir, proto);
|
proto = new Prototype (protoDir, app);
|
||||||
prototypes.put (list[i], proto);
|
registerPrototype (list[i], protoDir, proto);
|
||||||
if ("hopobject".equalsIgnoreCase (list[i]))
|
prototypes.put (list[i], proto);
|
||||||
nodeProto = proto;
|
if ("hopobject".equalsIgnoreCase (list[i]))
|
||||||
// give logger thread a chance to tell what's going on
|
nodeProto = proto;
|
||||||
Thread.yield();
|
// give logger thread a chance to tell what's going on
|
||||||
}
|
Thread.yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ignore) {
|
|
||||||
app.logEvent (this+": "+ignore);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rewire) {
|
if (rewire) {
|
||||||
|
@ -143,7 +140,9 @@ public class TypeManager implements Runnable {
|
||||||
// app.logEvent ("Typechecker interrupted");
|
// app.logEvent ("Typechecker interrupted");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
check ();
|
try {
|
||||||
|
check ();
|
||||||
|
} catch (Exception ignore) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class ParentInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
isroot = "root".equals (propname);
|
isroot = "root".equals (propname);
|
||||||
System.err.println ("created "+this);
|
// System.err.println ("created "+this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString () {
|
public String toString () {
|
||||||
|
|
|
@ -609,6 +609,7 @@ public class Node implements INode, Serializable {
|
||||||
anonymous = !pinfo.named;
|
anonymous = !pinfo.named;
|
||||||
if (pinfo.virtualname != null)
|
if (pinfo.virtualname != null)
|
||||||
pn = pn.getNode (pinfo.virtualname, false);
|
pn = pn.getNode (pinfo.virtualname, false);
|
||||||
|
// FIXME: check for groupby
|
||||||
if (pn != null)
|
if (pn != null)
|
||||||
return pn;
|
return pn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import helma.util.*;
|
||||||
|
|
||||||
public class StandaloneServletClient extends AbstractServletClient {
|
public class StandaloneServletClient extends AbstractServletClient {
|
||||||
|
|
||||||
private IRemoteApp app = null;
|
private Application app = null;
|
||||||
private String appName;
|
private String appName;
|
||||||
private String serverProps;
|
private String serverProps;
|
||||||
|
|
||||||
|
@ -30,14 +30,19 @@ public class StandaloneServletClient extends AbstractServletClient {
|
||||||
super.init (init);
|
super.init (init);
|
||||||
}
|
}
|
||||||
|
|
||||||
IRemoteApp getApp (String appID) throws Exception {
|
synchronized IRemoteApp getApp (String appID) throws Exception {
|
||||||
if (app != null)
|
if (app != null)
|
||||||
return app;
|
return app;
|
||||||
|
try {
|
||||||
File propfile = new File (serverProps);
|
File propfile = new File (serverProps);
|
||||||
File hopHome = new File (propfile.getParent());
|
File hopHome = new File (propfile.getParent());
|
||||||
SystemProperties sysProps = new SystemProperties (propfile.getAbsolutePath());
|
SystemProperties sysProps = new SystemProperties (propfile.getAbsolutePath());
|
||||||
app = new Application (appName, sysProps, hopHome);
|
app = new Application (appName, sysProps, hopHome);
|
||||||
|
app.start ();
|
||||||
|
} catch (Exception x) {
|
||||||
|
System.err.println ("Error starting Application "+appName+": "+x);
|
||||||
|
x.printStackTrace ();
|
||||||
|
}
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue