• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about the stub

 
Ray Cheeny
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
please look the code:

1>Will all the clients have the same 'a' ?
2>Will all the clients have the same 'b' ?
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray,

1>Will all the clients have the same 'a' ?

Yes. They will receive a different stub into the same object.


2>Will all the clients have the same 'b' ?

Question is how will they ever get a reference to b? Your code doesn't show any way to access b unless class A holds a reference to it.
Hope this helps,
Michael Morris
 
Ray Cheeny
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I use the FactoryConnection class which has a mehtod named getConnection or something similar which returns an implementation of my remote Data interface(like return new RemoteAccess()).
Could I get a unique object of the RemoteAccess?
Is the getConnection of mine right?If not,please tell me how to do it.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray,
So long as your getConnection returns a new object (remote implementation) on every call then each client will have a unique connection.

Hope this helps,
Michael Morris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic