The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.rmi  [6 examples]

e189. Looking Up a Remote Object and Invoking a Method

    try {
        // Look up remote object
        RObject robj = (RObject) Naming.lookup("//localhost/RObjectServer");
    
        // Invoke method on remote object
        robj.aMethod();
    } catch (MalformedURLException e) {
    } catch (UnknownHostException e) {
    } catch (NotBoundException e) {
    } catch (RemoteException e) {
    }

 Related Examples
e187. Starting the RMI Registry
e188. Defining and Exporting a Remote Object
e190. Passing Parameters to a Remote Method
e191. Returning Values from a Remote Method
e192. Throwing an Exception from a Remote Method


© 2002 Addison-Wesley.