/* package */ Lock( final ILockDatabase lockDatabase, final LockOwner owner, final boolean isAutoCleanup, final int countLocked) { super(); Check.assumeNotNull(lockDatabase, "lockDatabase not null"); this.lockDatabase = lockDatabase; Check.assumeNotNull(owner, "owner not null"); Check.assume( owner.isRealOwnerOrNoOwner(), "owner shall be a real owner or no owner: {}", owner); this.owner = owner; this.isAutoCleanup = isAutoCleanup; _countLocked = countLocked; }
private final void assertHasRealOwner() { final LockOwner owner = getOwner(); Check.assume(owner.isRealOwner(), "lock {} shall have an owner", this); }