• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

is this Client ID correct?

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
is this correct???
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • 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
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic