• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CodeBase

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to know why do you use the codebase.
Heasrd that its a global classpath for a machine.. but could you let me more about it..
basically i am stuck
lets say
i have
1 hello interface
2 helloimpl class
3 helloserver class
4 helloclient class
now i have the helloclient class in some machine with ip as "x" and the helloimpl class is in some machine with ip "y".
i want to dynamically import the stub...
helloclient is not an applet
could you help me ???



------------------
denice the menace
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. The codebase is, basically, a URL (file, HTTP, or FTP) where the RMI Class Loader can look for any classes it needs (eg a stub class, or the class code for any serialized parameters the client recieves) that aren't in the local classpath. You set the codebase property for your server, and then the information is added to the stream each time a serialized object is sent to the client.
So, in your example, you can do this by running the HelloServer with the -Djava.rmi.server.codebase=(whatever your codebase is) flag. For instance, you could set the codebase to the document root of your HTTP server and put the appropriate stub class files there. (If you use a file URL, the classes can only be downloaded by a client that has access to your server's local file system.)
You also need to use a security manager to do this type of dynamic class loading, and also create an appropriate security policy - the default one doesn't give enough permissions to use RMI. You can find out how to do this in the Java Tutorial RMI bit, as far as I remember...
Hope that's helpful.
[This message has been edited by Lucy C (edited May 31, 2000).]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic