Hi all, I am not very much clear about concept of lease manager in .net Remoting. Can someone tell me how lease manager is used in remoting system. And how sponser interact with lease manager to handle timeout for remote object. Means whether lease manager present in application domain of server or is it on outside application domain. Please correct me and help me in understanding this conecpt. Thanks in advance.
Lifetime leases are used as an alternative mechanism to reference counting with which the framework can reclame memory resources through garbage collecting remotely activated objects. Every object that is activated out of the application domain (remote object) is granded a time lease. The lease manager of the remote application domain has the responsibility to check periodically if the lease of a particual instance has expired. If a lease manager finds that an object's lease has expired it iterates through the sponsors list associated with this object to query if there is a lease renewal and if there lease is not renewed the lease manager deletes the object. Sponsors are ISponsor implementations that are registered to a particular lease and are responsible for managing the lease time of remote objects. A sponsor can be registered in a lease. When the procedure above executes (the lease manager iterates through the sponsors) the sponsor is asked whether he wants to renew the time lease of the object. A high-level description would be : An object is given a specific lifetime and after that it will be destroyed. The user can add sponsors to the object that controls the destruction of these objects, where this sponsors can ask for more time for the object. The above have effect only for remotely activated objects. I hope I helped a little. Tasos