@ManagedAnnotation("remainingLeaseTime") @ManagedDescription("remaining time in milliseconds or -1 if not locked") public long getRemainingLeaseTime() { return managedObject.getRemainingLeaseTime(); }
@ManagedAnnotation("remainingLeaseTime") @ManagedDescription("remaining time in milliseconds or -1 if not locked") public long getRemainingLeaseTime() { return managedObject.getRemainingLeaseTime(); }
@Verify public void verify() { for (int i = 0; i < lockCount; i++) { ILock lock = targetInstance.getLock(name + i); boolean isLocked = lock.isLocked(); long remainingLeaseTime = lock.getRemainingLeaseTime(); if (isLocked) { String message = format("%s is locked with remainingLeaseTime: %d ms", lock, remainingLeaseTime); if (allowZeroMillisRemainingLeaseLockTime && remainingLeaseTime == 0) { logger.warning(message); } else { fail(message); } } if (remainingLeaseTime > 0) { fail(format("%s has remainingLeaseTime: %d ms", lock, remainingLeaseTime)); } } } }