Exemplo n.º 1
0
  /* 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;
  }
Exemplo n.º 2
0
 private final void assertHasRealOwner() {
   final LockOwner owner = getOwner();
   Check.assume(owner.isRealOwner(), "lock {} shall have an owner", this);
 }