Minor fixes for StandaloneServletClient

This commit is contained in:
hns 2001-03-05 19:19:54 +00:00
parent e383beaa08
commit 45da518a63
4 changed files with 38 additions and 33 deletions

View file

@ -62,8 +62,9 @@ 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)
throw new RuntimeException ("Can't read app directory "+appDir+" - check permissions");
for (int i=0; i<list.length; i++) { for (int i=0; i<list.length; i++) {
File protoDir = new File (appDir, list[i]); File protoDir = new File (appDir, list[i]);
// cut out ".." and other directories that contain "." // cut out ".." and other directories that contain "."
@ -86,10 +87,6 @@ public class TypeManager implements Runnable {
} }
} }
} catch (Exception ignore) {
app.logEvent (this+": "+ignore);
}
if (rewire) { if (rewire) {
// there have been changes @ DbMappings // there have been changes @ DbMappings
app.rewireDbMappings (); app.rewireDbMappings ();
@ -143,7 +140,9 @@ public class TypeManager implements Runnable {
// app.logEvent ("Typechecker interrupted"); // app.logEvent ("Typechecker interrupted");
break; break;
} }
try {
check (); check ();
} catch (Exception ignore) {}
} }
} }

View file

@ -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 () {

View file

@ -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;
} }

View file

@ -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;
} }