ILease Interface

Definição

Define um objeto de concessão de tempo de vida que é usado pelo serviço de tempo de vida de comunicação remota.Defines a lifetime lease object that is used by the remoting lifetime service.

public interface class ILease
public interface ILease
[System.Runtime.InteropServices.ComVisible(true)]
public interface ILease
type ILease = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type ILease = interface
Public Interface ILease
Atributos

Comentários

Controles de coleta de lixo distribuídos quando aplicativos de servidor podem ser excluídos.Distributed garbage collection controls when server applications can be deleted. Tradicionalmente, a coleta de lixo distribuída usa contagens de referência e ping para controle.Traditionally, distributed garbage collection uses reference counts and pinging for control. Isso funciona bem quando há alguns clientes por objeto, mas não funciona bem quando há milhares de clientes por cada objeto.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. O serviço de tempo de vida pode assumir a função de um coletor de lixo distribuído tradicional e é bem dimensionado quando o número de clientes aumenta.The lifetime service can assume the function of a traditional distributed garbage collector, and scales well when the number of clients increases.

O serviço de tempo de vida associa uma concessão a cada objeto ativado remotamente.The lifetime service associates a lease with each remotely activated object. Quando a concessão expira, o objeto é removido.When the lease expires, the object is removed. Uma concessão pode especificar que um objeto tem um tempo de vida infinito.A lease can specify that an object has an infinite lifetime.

Cada AppDomain contém um Gerenciador de concessão que administra as concessões no domínio.Each AppDomain contains a lease manager that administers the leases in the domain. Periodicamente, o Gerenciador de concessão examina as concessões de expiração de tempo.The lease manager periodically examines the leases for time expiration. Se uma concessão tiver expirado, ela poderá ser cancelada removendo sua referência à concessão ou renovada invocando um ou mais dos patrocinadores da concessão.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.

Uma concessão contém propriedades que determinam suas políticas e métodos que renovam o tempo de concessão.A lease contains properties that determine its policies, and methods that renew the lease time. A concessão expõe a ILease interface.The lease exposes the ILease interface.

Para obter um exemplo que mostra como usar a ILease interface, consulte vidas úteis.For an example showing how to use the ILease interface see Lifetimes.

Propriedades

CurrentLeaseTime

Obtém a quantidade de tempo restante na concessão.Gets the amount of time remaining on the lease.

CurrentState

Obtém o LeaseState atual da concessão.Gets the current LeaseState of the lease.

InitialLeaseTime

Obtém ou define a hora inicial para a concessão.Gets or sets the initial time for the lease.

RenewOnCallTime

Obtém ou define a quantidade de tempo pela qual uma chamada para o objeto remoto renova o CurrentLeaseTime.Gets or sets the amount of time by which a call to the remote object renews the CurrentLeaseTime.

SponsorshipTimeout

Obtém ou define a quantidade de tempo a esperar um responsável retornar com um tempo de renovação da concessão.Gets or sets the amount of time to wait for a sponsor to return with a lease renewal time.

Métodos

Register(ISponsor)

Registra um responsável para a concessão sem renovar a concessão.Registers a sponsor for the lease without renewing the lease.

Register(ISponsor, TimeSpan)

Registra um responsável para a concessão e renova-a pelo TimeSpan especificado.Registers a sponsor for the lease, and renews it by the specified TimeSpan.

Renew(TimeSpan)

Renova uma concessão pelo tempo especificado.Renews a lease for the specified time.

Unregister(ISponsor)

Remove um responsável da lista de responsáveis.Removes a sponsor from the sponsor list.

Aplica-se a