Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there only one remote object instance serving all clients

 
Pushker Chaubey
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

When multiple clients invoke a remote method on the same remote object, are all these methods invoked on the same instance.
Can we use remote object's field memebers to maintain state between remote method invocations?
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the server(remote) object is always the one that you have bound in the registry. All the remote calls from the client ends up into this object.

So, you can actually use the instance field of the remote object to maintain state. However, be sure that your remote object is thread-safe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic