-
- public final Object call(final JSArray args) throws JS.Exn {
- final Callback callback = JSContext.pause();
- new java.lang.Thread() {
- public void run() {
- try {
- final Object ret = call_(args);
- Scheduler.add(new Scheduler.Task() { public void perform() { callback.call(ret); } });
- } catch (IOException se) {
- if (Log.on) Log.log(this, se);
- throw new JS.Exn("socket exception: " + se);
- }
- } }.start();
- return null;
- }
-
- /** When you get a property from an XMLRPC, it just returns another XMLRPC with the property name tacked onto methodname. */
- public Object get(Object name) {
- return new XMLRPC(url, (methodname.equals("") ? "" : methodname + ".") + name.toString(), http);
- }
-
- public XMLRPC(String url, String methodname) {
- this(url, methodname, new HTTP(url));
- }
-
- public XMLRPC(String url, String methodname, HTTP http) {
- this.http = http;
- this.url = url;
- this.methodname = methodname;
- }
-
-
- // Helper Classes ///////////////////////////////////////////////////////////////////////////////////
-
- /** CharArrayWriter that lets us touch its buffer */
- protected static class AccessibleCharArrayWriter extends CharArrayWriter {
- public char[] getBuf() { return buf; }
- public AccessibleCharArrayWriter(int i) { super(i); }
- }
-