File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes RMI - Client code, Remote Interface and Data class - Classpath or Codebase? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI - Client code, Remote Interface and Data class - Classpath or Codebase?" Watch "RMI - Client code, Remote Interface and Data class - Classpath or Codebase?" New topic
Author

RMI - Client code, Remote Interface and Data class - Classpath or Codebase?

Sudha Rams
Greenhorn

Joined: May 13, 2005
Posts: 12
Hello,

My RMI client consists of a Java command-line app that uses Naming.lookup to obtain a reference to the remote interface. Also, I have a data class that is used by both the RMI server components and RMI client components. This is the return type for the remote method invoked by the client.

What is the correct approach out of the options given below?

a) Include the remote interface and the data class in both the build and execution classpath. This is inevitable and is the only way to compile and execute the client app and remote implementation.

b) Include the remote interface and the data class in the build classpath. This is inevitable during development and is the only way to compile the client app and remote implementation code. However, at the time of execution, one may just mention the codebase so that the remote interface and/or data class bytecode gets downloaded. This is applicable to both the client app and the remote implementation.

Also, if there is any other approach apart from the ones that I have mentioned, please let me know.

Regards,
Sudha
[ August 29, 2005: Message edited by: Sudha Rams ]
Raj Murthy
Greenhorn

Joined: Oct 25, 2005
Posts: 14
So far we have been including the server and shared classes in both server and client
machines.
The client dynamically getting the stubs and shared-classes would be preferable.
What would be the performance implications, if any?
Please let me know if you post some command/code snippets that might help.

TIA,
Rajiv
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

A, works for a testing environment. This way you compile/test the client/server easily.

B, works for a production environment. As you add more functionality to your product you don't want to have to ship new classes to every client machine; they get the new classes with the codebase.


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI - Client code, Remote Interface and Data class - Classpath or Codebase?
 
Similar Threads
URLY bird, Exception handling problem
rmi deployment, confirm
Running a RMI Application
My RMI client consists of a Java command-line app
RMI connection to registry refused