|
How to invoke a method on a remote object |
|
|
This Java tips illustrates a method of looking up a remote object and invoking a method.
Developer may first check for the availability of the remote object and then in case
remote object exist, its method is invoked.
try {
// Look up a 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 Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.