This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stopping rmi registry

 
Jacob George
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I am relatively new to RMI technology. What we are trying to build is a server which will register certain remote objects to the registry so that remote APIs could get them. The registry is started internally by the Server using LocateRegistry.createRegistry(port) function call. But I didn't find any function call to stop the registry. I tried unbinding all the objects from the registry, but the registry is still running in the background. Is there any way to stop the registry service through my program.
What I am trying to implement is a server GUI with "start" and "stop" buttons. So I have to stop the registry also to get the port free. Please help me with this..

Thanking You,
regards Jacob
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacob -
(Raving opinion) -
LocateRegistry.createRegistry() is a poorly conceived idea. It encapsulates a system call that launches the registry process on your system, but does not provide a control for that process. It makes sense that you shouldn't be able to turn off rmiregistry via LocateRegistry; because of that, I'm not sure it makes sense to allow it, either.
Oh well, now we know why I'm not invited to design meetings.
(/Raving opinion)
You can still turn rmiregistry off by a getting a Process reference and killing that. However, the application would have to be started with equal or stronger access rights to insure it will work.
 
Jacob George
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply. What I am trying to create is a server which registers many remote objects with the registry on starting, and removes the same while stopping. For registering, I have to get the registry started first. So I am using the createRegistry() function for the same. Are there any better ways to it??
regards Jacob
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,
It's interesting that locateRegistry starts a process: I always thought that it worked within the same process as the launching app. You seem to know more about this then I do, can you point me to a reference that talks about this?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!