File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI - bind vs rebind Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI - bind vs rebind" Watch "RMI - bind vs rebind" New topic

RMI - bind vs rebind

Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 168

Hey Folks,

While setting up an RMI connection it came to my attention that I can use or .

The main difference from what I can tell is:

If using the rebind method, any existing binding for the name is replaced. Thus is removing the chance of an AlreadyBoundException.

So some questions-

  • 1
  • When the program exits, will all binding be cleanly undone?
  • 2
  • Can you share your thoughts on the use of either one over the other?

    Roberto Perillo

    Joined: Dec 28, 2007
    Posts: 2271

    I myself didn't care about this... I just used rebind and was happy

    Cheers, Bob "John Lennon" Perillo
    SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
    Roel De Nijs

    Joined: Jul 19, 2004
    Posts: 8357

    I used rebind-method from Registry.

    SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
    OCAJP 7
    Anayonkar Shivalkar

    Joined: Dec 08, 2010
    Posts: 1545

    Ditto here

    The reason being - we are really not required to write a 'very high performance' code.

    Secondly, I used to click 'close' button of my GUI window to shut down the application so, frankly, I didn't care about cleaning up - oh, and I also used rebind instead of bind.

    Bottom line : everybody is happy as long as you are not breaking any 'MUST' requirement.

    Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
    Glen Iris
    Ranch Hand

    Joined: Jul 13, 2011
    Posts: 168

    Thank you chaps.
    I agree. Here's the link:
    subject: RMI - bind vs rebind
    It's not a secret anymore!