com.netflix.eureka.lease
Interface LeaseManager<T>

Type Parameters:
T -
All Known Implementing Classes:
InstanceRegistry, PeerAwareInstanceRegistry

public interface LeaseManager<T>

This class is responsible for creating/renewing and evicting a lease for a particular instance.

Leases determine what instances receive traffic. When there is no renewal request from the client, the lease gets expired and the instances are evicted out of InstanceRegistry. This is key to instances receiving traffic or not.


Method Summary
 boolean cancel(java.lang.String appName, java.lang.String id, boolean isReplication)
          Cancel the Lease associated w/ the passed in appName and id
 void evict()
          Evict Ts with expired Lease(s).
 void register(T r, int leaseDuration, boolean isReplication)
          Assign a new Lease to the passed in T
 boolean renew(java.lang.String appName, java.lang.String id, boolean isReplication)
          Renew the Lease associated w/ the passed in appName and id
 

Method Detail

register

void register(T r,
              int leaseDuration,
              boolean isReplication)
Assign a new Lease to the passed in T

Parameters:
r - - T to register
leaseDuration -
isReplication - - whether this is a replicated entry from another eureka node.

cancel

boolean cancel(java.lang.String appName,
               java.lang.String id,
               boolean isReplication)
Cancel the Lease associated w/ the passed in appName and id

Parameters:
appName - - unique id of the application.
id - - unique id within appName.
isReplication - - whether this is a replicated entry from another eureka node.
Returns:
true, if the operation was successful, false otherwise.

renew

boolean renew(java.lang.String appName,
              java.lang.String id,
              boolean isReplication)
Renew the Lease associated w/ the passed in appName and id

Parameters:
id - - unique id within appName
isReplication - - whether this is a replicated entry from another ds node
Returns:
whether the operation of successful

evict

void evict()
Evict Ts with expired Lease(s).