public interface ILease
|
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 | Read-only Gets the amount of time remaining on the lease. |
CurrentState | Read-only Gets the current LeaseState of the lease. |
InitialLeaseTime | Read-write Gets or sets the initial time for the lease. |
RenewOnCallTime | Read-write Gets or sets the amount of time by which a call to the remote object increases the ILease.CurrentLeaseTime. |
SponsorshipTimeout | Read-write Gets or sets the amount of time to wait for a sponsor to return with a lease renewal time. |
Register | Overloaded:Register(ISponsor obj) Registers a sponsor for the lease without renewing the lease. |
Register | Overloaded:Register(ISponsor obj, TimeSpan renewalTime) Registers a sponsor for the lease, and renews it by the specified TimeSpan. |
Renew | Renews a lease for the specified time. |
Unregister | Removes a sponsor from the sponsor list. |
TimeSpan CurrentLeaseTime {get;}
|
LeaseState CurrentState {get;}
|
TimeSpan InitialLeaseTime {get; set;}
|
TimeSpan RenewOnCallTime {get; set;}
|
TimeSpan SponsorshipTimeout {get; set;}
|
If a sponsor does not respond to a call to renew a lease within the time-out period, it is assumed to be dead and is removed from the list of sponsors for the current lease.
void Register( |
obj
obj
renewalTime
renewalTime
obj