This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should I use Naming or InitialContext to bind my server?

 
Stevens Miller
Bartender
Posts: 1244
24
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an rmiregistry process running when I execute the main method in this class:


It works perfectly.

This code also works perfectly:


They are the same, except for Line 19. Using the debugger as far as I can, I don't see that these two classes (InitialContext and Naming) rely on the same code, yet (in this application) they do very similar things.

Why are there two ways to bind a registry entry to an object?

What, if anything, would make one preferable to the other?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic