File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to stop rmiregistry ??

 
Rasika Chitnis
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone knows how to stop rmiregistry in NT ?
thanks
 
amit ahuja
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I open the rmiregistry thro' the code itself, so need not close it explicitly. When my server is is closed, registry closes by itself.
Other than that i don't know any way to close registry on NT except poor man's favourite crtl-C.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I put it into code, I used ctrl-c. It works like a charm
Mark
 
Rasika Chitnis
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks all for your replies. BTW, does it matter if rmiregistry is started from code or from the command line ? Is first approach preferable than the second one ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I don't think that it matters, but it is really easy to put into code, and that makes the grader not have to start or end it.
Mark
 
Rasika Chitnis
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, Mark. It makes sense. Are you also setting system property e.g. java.security.policy and java.rmi.server.codebase etc from within the code instead of setting these from command line ??
thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I have an executable jar file, and a policy all file. Only the client run locally does not use the policy file. I don't have codebase anywhere.
Mark
 
kerry shih
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question. If you boot up using the local protocal do you guys require the RMI Registry to be started or do you "switch" it out for local vs remote usage. I have a DataClient that uses a Singleton data service that on first initialization binds an interface into the registry. I didn't want to have the registration based on whether the data client wanted to be local or remote. Any thoughts?
 
Siddharth Mehrotra
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
even i was thinkin on the same line.
as u people have been disussing on the RMI registry.
can u please tell me the code or syntaxx as to how i start and stop RMI regisrty from code.
thanking you in advance
sid
------------------
Sid
 
R Bischof
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sid,
you may use
java.rmi.registry.Registry registry = java.rmi.registry.LocateRegistry.createRegistry( port );
where the default port is 1099

But how do you gracefully stop it? I think this has not been covered in this thread.
I have no idea. I first unbind the bootstraped instance of my dataserver but still there may be lots of DataSession open.
There might be some clients currently performing a transaction when I call System.exit().

I think the only clean way is to unbind the bootstrapped instance, stop the registry without a System.exit() (how?) and let all RMI threads finish what they are currently doing (how?).
Any idea?
Thx
Rainer
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am aswell waiting for the answer for the same question
1 start registry using code and bind a instance of RemoteObject
but then later if user wants to stop the stop i do the unbind of the remote object. But the RMI registry will still be running how to stop it is it at all possible to stop it
Please any one reply
Farouk
 
christy smile
Ranch Hand
Posts: 101
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, All,
I am bring this thread up again. I am also looking for code to stop the rmiregistry. The reason I need it is because in my Server GUI, I have a stop button which stops the current session of the Server, not kill the whole server app. Once the user clicks on the stop button, he/she can specify another database to be bound and restart the server. therefore, I need a way either to shut down the RMIRegistry or to check if the RMIRegistry is already open for the port and host (the host is most likely localhost since createRegistry() does not allow you to specify a hostname).
Thank you very much!
Christy
 
parthiban subramaniam
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
i would suggest not to think in terms of closing and starting the rmi registry b'cos its not needed once created let it die when the whole application is shut down .. bind and unbind your remote object.
and in my design a data(file) can be added or removed from the service hosted no matter if the service is bound or not
and i don't think there is one method to close the registry
hmmm chked it out but if you find one plz do let me know
cheers,
parthi.
 
christy smile
Ranch Hand
Posts: 101
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Parthi,
Totally good idea!!! I am doing the same now (just binding and unbinding my database now
No more searching the closing the RMIRegistry. How come I did not think about earlier
Christy
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic