Package com.netflix.eureka.lease
Interface LeaseManager<T>
-
- Type Parameters:
T-
- All Known Subinterfaces:
InstanceRegistry,PeerAwareInstanceRegistry
- All Known Implementing Classes:
AbstractInstanceRegistry,AwsInstanceRegistry,PeerAwareInstanceRegistryImpl
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
AbstractInstanceRegistry. This is key to instances receiving traffic or not.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancancel(java.lang.String appName, java.lang.String id, boolean isReplication)voidevict()EvictLeaseManagers with expiredLease(s).voidregister(T r, int leaseDuration, boolean isReplication)Assign a newLeaseto the passed inLeaseManager.booleanrenew(java.lang.String appName, java.lang.String id, boolean isReplication)
-
-
-
Method Detail
-
register
void register(T r, int leaseDuration, boolean isReplication)
Assign a newLeaseto the passed inLeaseManager.- Parameters:
r- - T to registerleaseDuration-isReplication- - whether this is a replicated entry from another eureka node.
-
cancel
boolean cancel(java.lang.String appName, java.lang.String id, boolean isReplication)- 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)- Parameters:
id- - unique id within appNameisReplication- - whether this is a replicated entry from another ds node- Returns:
- whether the operation of successful
-
evict
void evict()
EvictLeaseManagers with expiredLease(s).
-
-