• 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

how to stop rmiregistry ??

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone knows how to stop rmiregistry in NT ?
thanks
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic