RMI Section Index | Page 7
Is there any limit on the time duration of an RMI call? Does RMI support timeouts?
We know of no time limit for an RMI Call. However, consider the following:
When timing a request, the RMI Connection thread cannot time itself. If it gets caught in a long or never ending loop ...more
When implementing methods of remote interface, what's the design pattern for handling exceptions in those methods? Should I catch all Throwables and rethrow RemoteException, or will the stub take care of it?
It is the choice of developer rather than any set design pattern. If the remote server wants to provide summary information about the cause of failure, then it's better to have the exception caugh...more
How I can set the maximum number of requests that can be handled by a multithreaded RMI server(an object which extends UnicastRemoteObject)?
My understanding is that the standard RMI does not permit any way for you to limit this. If you wish to limit the number of requests that your server will handle then you will have to implement th...more
Can I call a JNI method using RMI?
There is nothing that stops an RMI server from making native method calls. The client doesn't know it is making a request that will eventually be carried out with native code.
What is a replicated RMI Object?
A replicated RMI object is one that offers transparent failover or load balancing.
Is there any way to catch the situation where the server side of the RMI program fails to return to the client (i.e. client calls a method on the server and while the server is processing, the client machine dies...I want to be able to catch this on the server side)
This can be implemented by using the CallBack mechanism, where the server holds the reference of the client object. For every call on the remote server using the object, pass on the client ID (whi...more
How can I create and register a custom RMI stub generated dynamically using the new JDK 1.3 dynamic proxy classes?
There is an excellent package from Rickard Öberg which uses dynamic proxy classes to eliminate the need for RMIC itself. The package can be downloaded from:
http://www.dreambean.com/download/...more
How can my CORBA client (written in C++) communicate with an RMI server using the RMI/IIOP mechanism?
The following article has samples for a CORBA/C++ Server, CORBA/C++ Client, Java-RMI based Server and a Java-RMI based client. With this you can test interoperability between the Java-RMI and C++/...more
Under what circumstances would I get a java.rmi.NoSuchObjectException?
Quoting from the RMI Javadocs:
"A NoSuchObjectException is thrown if an attempt is made to invoke a method on an object that no longer exists in the remote virtual machine. If a
NoSuchObjectE...more
Why is rmic invoked on the implementation class and not on the remote interface?
RMIC is invoked on the implementation class as this class may be implementing n-number of remote interfaces. Otherwise, we would have to supply all the n-number of interfaces to rmic or invoke rmi...more
If the RMI client & server are located on the same machine, what is the overhead of invoking remote method in this situation compared to a local method call? Will the call go through the entire TCP/IP stack, stub and skeleton or will it will be treated as a local invocation?
If the RMI client & server are
located on the same machine, what is
the overhead of invoking remote method
in this situation compared to a
local method call? Will the call go
through the entir...more
Is there a way to run rmiregisty and my RMI servers in the background under Win32?
You can make use of the Windows JDK utility javaw to fire-up the Java interpreter as a separate process and run rmiregistry and your server in the background.
For example, you can start up rmireg...more
I get "com.sun.rmi.rmid.ExecOptionPermission" when I try to use ActivationGroupID constructor with a policy file as property. I've read that I need to set a specific rmid policy file but my tries failed. What could be wrong here?
Create a wrapper script like this:
grant {
};
save that as policy.rmid, and run rmid as
rmid -J-Djava.security.policy=policy.rmid
then say you get an error; just add in the error in question
b...more
Where can I find the official documentation of the Sun Java SDK tools?
You can find the official Sun documentation for all of the
tools in the Java 2 SDK including javac, java, javadoc, appletviewer,
jar, jdb, javah, javap, extcheck, rmic, rmiregistry,
rmid, serialve...more
Where can I find the API documentation for Activation?
You can find the activation API documentation from Sun's
J2EE API documentation page.