5859606162636465666768
case COUNT_DOWN_OPERATION: return new CountDownOperation(); case GET_COUNT_OPERATION: return new GetCountOperation(); case SET_COUNT_OPERATION: return new SetCountOperation(); default: return null; } } };
808182838485868788
return f.getSafely(); } @Override public boolean trySetCount(int count) { SetCountOperation op = new SetCountOperation(name, count); InternalCompletableFuture<Boolean> f = invoke(op); return f.getSafely(); }
49505152535455
return name; } @Override protected Operation prepareOperation() { return new SetCountOperation(name, count); }
838485868788899091
@Override public boolean trySetCount(int count) { if (count < 0) { throw new IllegalArgumentException("count can't be negative"); } SetCountOperation op = new SetCountOperation(name, count); InternalCompletableFuture<Boolean> f = invoke(op); return f.getSafely(); }