Interface Leased
-
- All Known Implementing Classes:
ClusteredExecutorInfo
public interface LeasedALeasedobject is one that supports tracking of last use and automated cleanup upon expiry.- Since:
- 21.12
- Author:
- bo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetLeaseExpiryTime()Obtains the time the lease will expiry (in milliseconds since the epoc).booleanonLeaseExpiry()A callback invoked as part of anInvocableMap.EntryProcessorto perform custom lease expiry operations when a lease has expired.voidrenew()Renews the lease for some period of time.
-
-
-
Method Detail
-
renew
void renew()
Renews the lease for some period of time.
-
getLeaseExpiryTime
long getLeaseExpiryTime()
Obtains the time the lease will expiry (in milliseconds since the epoc).- Returns:
- the time in milliseconds since the epoc
-
onLeaseExpiry
boolean onLeaseExpiry()
A callback invoked as part of anInvocableMap.EntryProcessorto perform custom lease expiry operations when a lease has expired.- Returns:
trueif theLeasedstate was mutated and should be saved,falseotherwise
-
-