Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18. Remote Deployment with RMI: Distribu... > How does the client get the stub obj...

How does the client get the stub object?

The client has to get the stub object, since that’s the thing the client will call methods on. And that’s where the RMI registry comes in. The client does a ‘lookup’, like going to the white pages of a phone book, and essentially says, “Here’s a name, and I’d like the stub that goes with that name.”

image with no caption
image with no caption
  1. Client does a lookup on the RMI registry

    Naming.lookup("rmi://127.0.0.1/Remote Hello");
    
  2. RMI registry returns the stub object

    (as the return value of the lookup method) and RMI deserializes the stub automatically. You MUST have the stub class (that rmic generated for you) on the client or the stub won’t be deserialized.

  3. Client invokes a method on the stub, as though the stub IS the real service


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint