• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Registry stop after timeout

 
Alex Sasha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have several RMI servers , that are working, and if they have nothing to do they stop after idle timeout. When client starts if tests if the server is working and if not then it starts the server. There are two possibility to start RMI Registry LocalRegistry.createRegistry or starting it in a separate process rmiregistry.
If I use the first solution as soon the first server stops all other serves stay running but without registry and client can’t find them.
If I use the second solution rmiregistry is working forever till it’s stopped manually, and that is not good, because it should free memory after idle timeout.

The only solution for this problem I see is to write separate server that is creating registry using LocalRegistry.createRegistry inside itself, and stops after all servers are unregistered(the question is how to recognize this situation) and after idle timeout. Is the any simpler solution?
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The locate is just for a single server.

Use the rmiregistry. It doesn't take much memory. Since it's a Java process, you can control just how much memory is allocated.

Instead of stopping the Servers, look into the Activation framework. You can deactivate a server after an idle period and bring it back up on a call instead of having to restart the server.
 
Alex Sasha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don’t really understand, who gonna start the server as a process? JAF? and how?

i my case it’s a customer requirement to stop all related processes after timeout, rmiregistry should be stopped as well
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to program magically stop the RMIRegistry. Since it is a Java process itself, you will have to figure out some way to do it.
 
Alex Sasha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward Harned wrote:There is no way to program magically stop the RMIRegistry. Since it is a Java process itself, you will have to figure out some way to do it.

Then i have to write small program that calls LocalRegistry.createRegisty, and stops after idle timeout, that't the only way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic