This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LocateRegistry.getRegistry (1234);

 
Charlie Goth
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LocateRegistry.getRegistry(1234);
I'm running this code which returns a Registry, is there an easy way of telling there is actually a registry running? I assumed it would return null if there isn't one on localhost port 1234. At the moment I'm having to call list() on the returned registry, using a thrown exception to indicate there's no registry bound on that port.
Thanks
Charlie
 
Chris Shepherd
Ranch Hand
Posts: 286
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Charlie, I think your question just answered a question that was posed in another post.
I think you've got about the only way to detect an actual registry. The docs essentially state that there is no way to know if you actually hook up to a real registry. You could streamline the process a little by going ahead and trying to rebind your server to the returned registry object and watching for an error from that. If it threw errors, just programatically start a new registry in the catch() section and do the same rebind process over again.
It should work pretty well.
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic