• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

is this Client ID correct?

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Client connects to RMI server and get the Remote object (obj).
This (obj) connects to a method in implementation class to return (new Implementation()) which is considered the Client ID.
When I run to Dos Windows (it means 2 Clients) and print the (new Implementation()) object, the message below shown:
Get Client ID: HelloServerImpl_Stub[RemoteStub [ref: [endpoint:[203.79.98.192:3141](remote),objID:[1ad086a:f336dba45f:-8000, 2]]]]
The message for the other Client is:
Get Client ID: HelloServerImpl_Stub[RemoteStub [ref: [endpoint:[203.79.98.192:3141](remote),objID:[1ad086a:f336dba45f:-8000, 4]]]]
You can notice the difference only in number 2 and number 4
Is that mean it is really different reference and then can be used as a Client ID???
Cheers
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your client connect to a remote factory that then creates a unique object for each connection request? If so then yes this can be used as the client id.
 
Qusay Jaafar
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my Client connects to abstract ConnectionFactory class which return either (new NetworkConnection()) or (new LocalConnection()).
(new NetworkConnection()) has Naming.lookup() service which connects to RMI server and then return the Remote object (obj).
(obj) calls getClientID() in Implementation class and return (new Implementation()) object.
(new Implementation()) is the Client ID.
Isn't it???
thanks
 
Qusay Jaafar
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is this correct???
 
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
Qusay, that sounds right. Your network version gets the object that is in the registry, and calls a method on it to return a Remote Implementation object. This is the cient id you are looking for.
Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic