aspose file tools*
The moose likes Distributed Java and the fly likes Dynamic ClassLoading in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Dynamic ClassLoading in RMI" Watch "Dynamic ClassLoading in RMI" New topic
Author

Dynamic ClassLoading in RMI

Radha MahaLakshmi
Ranch Hand

Joined: Mar 28, 2003
Posts: 45
Hi
I am developing an application using RMI and i am through with that.Now i wanted to use the dynamic class loaindg to load the required classes in runtime insted of coping those classes in the clients machine and made avilable through classpath.Here i need some claifications.
let us say i am working on a machine m1 and i am developing some client code like HelloClient.for this i have a remote interface Hello.java and implementation class HelloImpl.java.
When i use the dynamic classloading what are all the classes would be downloaded from the code base.Do i need to copy the client class also into the code base and download or i can run the client class from my machine and the HelloImpl_stub.class will be downloaded automatically.
Can some body provide small smple for this dynamic loading.
Regards
Radha
[ August 24, 2003: Message edited by: Radha MahaLakshmi ]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Moving to the RMI forum (Distributed Java).


"JavaRanch, where the deer and the Certified play" - David O'Meara
Diego Bowen
Ranch Hand

Joined: Aug 19, 2003
Posts: 50
Hello there, from my reading thus far, the xxx_Stub.class is the only class that gets loaded at runtime using a class loader. I do however have a question to pose to the rest of the RMI community. I have successfully got a RMI helloWorld app running on two machines. Where M1 the server, has Hello.class, HelloImpl.class, HelloImpl_Stub.class, HelloImpl_Skel.class and HelloServer.class. M2 the client, the HelloClient.class, Hello.class and HelloImpl_stub.class. My question is: Since there is no "dynamic" loading of classes, in particular the "HelloImpl_Stub.class", are there any SECURITY issues involved? Considering that I want this to be as secure as possible?
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
Dynamic class loading makes passing of data as well as behavior. Using dynamic class loading, we can send full object graph by passing an object as the argument to a method call. The only requirement for passing the object is that the object be serializable.
One should remember that in dynamic class loading, the object instance is serialized rather than it's stub
Coming to your application,you should have HelloImpl_stub.class on the client side.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic ClassLoading in RMI
 
Similar Threads
distributing my RMI app
Head First Java RMI Universal Service Browser Question
loading RMI class (Stub's) for client using cobebase
Regarding the order of UML diagrams in Design
Development nearing end ... docs next... but question.