commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hammant <Paul_Hamm...@yahoo.com>
Subject [AltRMI] More use of
Date Sun, 13 Jan 2002 11:41:25 GMT
Folks,

I've upgraded the 'helloworld' demo in Avalon to also accept 
setGreeting() calls over AltRMI.  See the posting in Avalon-dev's maillist.

I've also updated the BeanShell fork I maintain at 
http://jesktopapps.sourceforge.net/ so that it can similarly poke any 
method published by AltRMI anywhere.  arLookup(..) is the .bsh script. 
 Here it is:

    bsh.help.arLookup = "usage: arLookup(host, port, name), returns object";
    /*
        By Paul Hammant : Specifically for Jesktop
    */
    Object arLookup(String host, int port, String name) {
        org.apache.commons.altrmi.client.AltrmiFactory af = new 
org.apache.commons.altrmi.client.impl.ServerClassAltrmiFactory();
        af.setHostContext(new 
org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamHostContext(host, 
port));
        return af.lookup(name, true);   
    }

Just three lines of code :-)  Typical use below (in Beanshell's console):

    hws = arLookup("127.0.0.1",8666,"helloworld");
    hws.setGreeting("AltRMI rocks");

Regards,

- Paul H



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message