2003/11/03 06:32:55
[org.ibex.core.git] / src / org / xwt / XMLRPC.java
index ac83249..e32f569 100644 (file)
@@ -359,17 +359,19 @@ class XMLRPC extends JS.Callable {
         return objects.elementAt(0);
     }
 
-    public final Object call(JS.Array args) throws JS.Exn {
-        try {
-            return call2(args);
-        } catch (IOException se) {
-            if (Log.on) Log.log(this, se);
-            throw new JS.Exn("socket exception: " + se);
-
-        } catch (JS.Exn jse) {
-            if (Log.on) Log.log(this, jse.toString());
-            throw jse;
-        }
+    public final Object call(final JS.Array args) throws JS.Exn {
+        final JS.Context cx = JS.Context.current();
+        Scheduler.add(new Scheduler.Task() { public void perform() {
+            Object ret;
+            try {
+                ret = call2(args);
+            } catch (IOException se) {
+                if (Log.on) Log.log(this, se);
+                throw new JS.Exn("socket exception: " + se);
+            }
+            cx.resume(ret);
+        } });
+        return JS.Context.pause;
     }
 
     /** When you get a property from an XMLRPC, it just returns another XMLRPC with the property name tacked onto methodname. */