anyone knows how to stop rmiregistry in NT ? thanks
amit ahuja
Ranch Hand
Joined: Nov 20, 2001
Posts: 38
posted
0
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.
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 ?
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
Joined: Jun 19, 2001
Posts: 131
posted
0
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
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
Joined: Nov 04, 2001
Posts: 15
posted
0
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
Joined: Aug 21, 2001
Posts: 185
posted
0
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
SCJP, SCJD.
R Bischof
Ranch Hand
Joined: Feb 13, 2001
Posts: 48
posted
0
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
Rainer<br />SCJP, SCJD, SCWCD
Farouk Mohamed1
Ranch Hand
Joined: Jul 26, 2001
Posts: 113
posted
0
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
Joined: Oct 15, 2001
Posts: 101
posted
0
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
Joined: May 15, 2002
Posts: 116
posted
0
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.
Even crazy and silly looking problems are sometimes real.
christy smile
Ranch Hand
Joined: Oct 15, 2001
Posts: 101
posted
0
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