• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiples clients have multiple remote objects  RSS feed

 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Binding a object when server creates only one instance of the remote object and this design promotes multiple clients to use single remote object.
Can anyone tell me a design by which multiple clients can have multiple remote objects.
Please help this is required urgently
Farouk
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Farouk -
Why not put a method in your service object that returns a reference to a new object? A Factory pattern suffices here.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information
Michael
If i understand things correctly do u mean we can have a factory bound to the registry when the server starts and every connect message to the factory from the client creates a new implementation object(X) which is aswell a remote object.
Question:1
1.I would like to implement java.rim.dgc.unreferenced in the Remote Object(X). Is unreferenced message called by the server in object(X) just before removing it from the list (reference list kept by the Garbage collector) or
after removing it from the list.
2. You know that when client looks up he gets a ConnectionManager server referece usign which the client issues a connect and get a stub reference of remote Object (X).
How do u implement a removal(disconnect) of object from the server when the client says i wanna disconect from the server
Do you know any mechanim which can do this explicity (not which does based on jvm specification about lease) unreferenced can u explain.
Please reply.
Your reply will be mucgh appreciated
Farouk
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Farouk - there are a couple of ways to go about this, but the entire mechanism you're looking for probably is a better fit for Jini (which has already worked these issues out). Have you looked into that at all?
These are good questions, and pretty involved to answer. I've been trying to think of some concise pointers to get you going, but I guess I'm stuck on how to pitch the response.
With native RMI, the leasing mechanism is built in, non-tunable, and based on nothing more than reference count, or rather lack of remote references. If you can live with the normal latencies of the distributed garbage collection mechanism, then you have what you need. You can't get direct, explicit controls, even in Jini.
What you can get from Jini, of course, is a modifiable lease. And again the idea is that you aren't trying to muck with the server's ability to control its own reference/registration process. In polite Java terms, that breaks encapsulation which you, the well-meaning and responsible Java citizen, do not want to be part of. Instead, you want an agreement that allows you to participate on your own terms, and that's a Lease.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael
Thanks for your reply. I think i will have have unreferenced interface implemented i think that is the maximum I can do
Thanks for your detailed reply
Hope you will have more questions from me later
Farouk
 
Patrick Wang
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael:
I have bought your book, excellent book.
My question is since each client has a unique remote interface
from the server, does that mean the RMI mechanism is not scalable? Assume 2 million clients using the same interface,
I guess RMI has to implement some queuing mechanism anyway?
Is this correct?
Pat
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!