ILease ILease ILease ILease Interface
Defines a lifetime lease object that is used by the remoting lifetime service.
public interface class ILease
[System.Runtime.InteropServices.ComVisible(true)] public interface ILease
type ILease = interface
Public Interface ILease
Distributed garbage collection controls when server applications can be deleted. Traditionally, distributed garbage collection uses reference counts and pinging for control. This works well when there are a few clients per object, but does not work well when there are thousands of clients per each object. The lifetime service can assume the function of a traditional distributed garbage collector, and scales well when the number of clients increases.
The lifetime service associates a lease with each remotely activated object. When the lease expires, the object is removed. A lease can specify that an object has an infinite lifetime.
Each AppDomain contains a lease manager that administers the leases in the domain. The lease manager periodically examines the leases for time expiration. If a lease has expired, it can either be canceled by removing its reference to the lease, or renewed by invoking one or more of the lease's sponsors.
A lease contains properties that determine its policies, and methods that renew the lease time. The lease exposes the ILease interface.
|CurrentLeaseTime CurrentLeaseTime CurrentLeaseTime CurrentLeaseTime||
Gets the amount of time remaining on the lease.
|CurrentState CurrentState CurrentState CurrentState||
Gets the current LeaseState of the lease.
|InitialLeaseTime InitialLeaseTime InitialLeaseTime InitialLeaseTime||
Gets or sets the initial time for the lease.
|RenewOnCallTime RenewOnCallTime RenewOnCallTime RenewOnCallTime||
Gets or sets the amount of time by which a call to the remote object renews the CurrentLeaseTime.
|SponsorshipTimeout SponsorshipTimeout SponsorshipTimeout SponsorshipTimeout||
Gets or sets the amount of time to wait for a sponsor to return with a lease renewal time.
|Register(ISponsor) Register(ISponsor) Register(ISponsor) Register(ISponsor)||
Registers a sponsor for the lease without renewing the lease.
|Register(ISponsor, TimeSpan) Register(ISponsor, TimeSpan) Register(ISponsor, TimeSpan) Register(ISponsor, TimeSpan)||
Registers a sponsor for the lease, and renews it by the specified TimeSpan.
|Renew(TimeSpan) Renew(TimeSpan) Renew(TimeSpan) Renew(TimeSpan)||
Renews a lease for the specified time.
|Unregister(ISponsor) Unregister(ISponsor) Unregister(ISponsor) Unregister(ISponsor)||
Removes a sponsor from the sponsor list.