From 146297c2c14e6f5234fb017874adc3bcd7974b5a Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Mon, 23 Dec 2019 09:24:32 +0300 Subject: [PATCH] javadocs updated --- .../org/redisson/api/RCountDownLatch.java | 86 +++---------------- .../redisson/api/RCountDownLatchAsync.java | 50 +++-------- .../redisson/api/RCountDownLatchReactive.java | 50 +++-------- .../org/redisson/api/RCountDownLatchRx.java | 50 +++-------- 4 files changed, 42 insertions(+), 194 deletions(-) diff --git a/redisson/src/main/java/org/redisson/api/RCountDownLatch.java b/redisson/src/main/java/org/redisson/api/RCountDownLatch.java index 7a60f2b77..0d5048855 100644 --- a/redisson/src/main/java/org/redisson/api/RCountDownLatch.java +++ b/redisson/src/main/java/org/redisson/api/RCountDownLatch.java @@ -18,7 +18,7 @@ package org.redisson.api; import java.util.concurrent.TimeUnit; /** - * Distributed implementation of {@link java.util.concurrent.CountDownLatch} + * Redis based implementation of {@link java.util.concurrent.CountDownLatch} * * It has an advantage over {@link java.util.concurrent.CountDownLatch} -- * count can be set via {@link #trySetCount} method. @@ -29,95 +29,33 @@ import java.util.concurrent.TimeUnit; public interface RCountDownLatch extends RObject, RCountDownLatchAsync { /** - * Causes the current thread to wait until the latch has counted down to - * zero, unless the thread is {@linkplain Thread#interrupt interrupted}. + * Waits until counter reach zero. * - *

If the current count is zero then this method returns immediately. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until one of two things happen: - *

- * - *

If the current thread: - *

- * then {@link InterruptedException} is thrown and the current thread's - * interrupted status is cleared. - * - * @throws InterruptedException if the current thread is interrupted - * while waiting + * @throws InterruptedException if the current thread was interrupted */ void await() throws InterruptedException; /** - * Causes the current thread to wait until the latch has counted down to - * zero, unless the thread is {@linkplain Thread#interrupt interrupted}, - * or the specified waiting time elapses. - * - *

If the current count is zero then this method returns immediately - * with the value {@code true}. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until one of three things happen: - *

- * - *

If the count reaches zero then the method returns with the - * value {@code true}. - * - *

If the current thread: - *

- * then {@link InterruptedException} is thrown and the current thread's - * interrupted status is cleared. - * - *

If the specified waiting time elapses then the value {@code false} - * is returned. If the time is less than or equal to zero, the method - * will not wait at all. + * Waits until counter reach zero or up to defined timeout. * * @param timeout the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return {@code true} if the count reached zero and {@code false} - * if the waiting time elapsed before the count reached zero - * @throws InterruptedException if the current thread is interrupted - * while waiting + * @param unit the time unit + * @return true if the count reached zero and false + * if timeout reached before the count reached zero + * @throws InterruptedException if the current thread was interrupted */ boolean await(long timeout, TimeUnit unit) throws InterruptedException; /** - * Decrements the count of the latch, releasing all waiting threads if - * the count reaches zero. - * - *

If the current count is greater than zero then it is decremented. - * If the new count is zero then all waiting threads are re-enabled for - * thread scheduling purposes. - * - *

If the current count equals zero then nothing happens. + * Decrements the counter of the latch. + * Notifies all waiting threads when count reaches zero. */ void countDown(); /** - * Returns the current count. - * - *

This method is typically used for debugging and testing purposes. + * Returns value of current count. * - * @return the current count + * @return current count */ long getCount(); diff --git a/redisson/src/main/java/org/redisson/api/RCountDownLatchAsync.java b/redisson/src/main/java/org/redisson/api/RCountDownLatchAsync.java index 267c70c89..18c0703f5 100644 --- a/redisson/src/main/java/org/redisson/api/RCountDownLatchAsync.java +++ b/redisson/src/main/java/org/redisson/api/RCountDownLatchAsync.java @@ -18,7 +18,7 @@ package org.redisson.api; import java.util.concurrent.TimeUnit; /** - * Async interface of {@link java.util.concurrent.CountDownLatch} + * Async interface of Redis based {@link java.util.concurrent.CountDownLatch} * * It has an advantage over {@link java.util.concurrent.CountDownLatch} -- * count can be set via {@link #trySetCountAsync} method. @@ -29,63 +29,33 @@ import java.util.concurrent.TimeUnit; public interface RCountDownLatchAsync extends RObjectAsync { /** - * Causes the current thread to wait until the latch has counted down to - * zero. + * Waits until counter reach zero. * - *

If the current count is zero then this method returns immediately. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDownAsync} method. + * @return void * */ RFuture awaitAsync(); /** - * Causes the current thread to wait until the latch has counted down to - * zero or the specified waiting time elapses. - * - *

If the current count is zero then this method returns immediately - * with the value {@code true}. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDownAsync()} method or the specified waiting time elapses. - * - *

If the count reaches zero then the method returns with the - * value {@code true}. - * - *

If the specified waiting time elapses then the value {@code false} - * is returned. If the time is less than or equal to zero, the method - * will not wait at all. + * Waits until counter reach zero or up to defined timeout. * * @param waitTime the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return {@code true} if the count reached zero and {@code false} - * if the waiting time elapsed before the count reached zero + * @param unit the time unit + * @return true if the count reached zero and false + * if timeout reached before the count reached zero */ RFuture awaitAsync(long waitTime, TimeUnit unit); /** - * Decrements the count of the latch, releasing all waiting threads if - * the count reaches zero. - * - *

If the current count is greater than zero then it is decremented. - * If the new count is zero then all waiting threads are re-enabled for - * thread scheduling purposes. - * - *

If the current count equals zero then nothing happens. + * Decrements the counter of the latch. + * Notifies all waiting threads when count reaches zero. * * @return void */ RFuture countDownAsync(); /** - * Returns the current count. - * - *

This method is typically used for debugging and testing purposes. + * Returns value of current count. * * @return the current count */ diff --git a/redisson/src/main/java/org/redisson/api/RCountDownLatchReactive.java b/redisson/src/main/java/org/redisson/api/RCountDownLatchReactive.java index ad5482833..0d2097a22 100644 --- a/redisson/src/main/java/org/redisson/api/RCountDownLatchReactive.java +++ b/redisson/src/main/java/org/redisson/api/RCountDownLatchReactive.java @@ -20,7 +20,7 @@ import reactor.core.publisher.Mono; import java.util.concurrent.TimeUnit; /** - * Reactive interface of {@link java.util.concurrent.CountDownLatch} + * Reactive interface of Redis based {@link java.util.concurrent.CountDownLatch} * * It has an advantage over {@link java.util.concurrent.CountDownLatch} -- * count can be set via {@link #trySetCount} method. @@ -31,63 +31,33 @@ import java.util.concurrent.TimeUnit; public interface RCountDownLatchReactive extends RObjectRx { /** - * Causes the current thread to wait until the latch has counted down to - * zero. + * Waits until counter reach zero. * - *

If the current count is zero then this method returns immediately. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDown} method. + * @return void * */ Mono await(); /** - * Causes the current thread to wait until the latch has counted down to - * zero or the specified waiting time elapses. - * - *

If the current count is zero then this method returns immediately - * with the value {@code true}. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDown()} method or the specified waiting time elapses. - * - *

If the count reaches zero then the method returns with the - * value {@code true}. - * - *

If the specified waiting time elapses then the value {@code false} - * is returned. If the time is less than or equal to zero, the method - * will not wait at all. + * Waits until counter reach zero or up to defined timeout. * * @param waitTime the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return {@code true} if the count reached zero and {@code false} - * if the waiting time elapsed before the count reached zero + * @param unit the time unit + * @return true if the count reached zero and false + * if timeout reached before the count reached zero */ Mono await(long waitTime, TimeUnit unit); /** - * Decrements the count of the latch, releasing all waiting threads if - * the count reaches zero. - * - *

If the current count is greater than zero then it is decremented. - * If the new count is zero then all waiting threads are re-enabled for - * thread scheduling purposes. - * - *

If the current count equals zero then nothing happens. + * Decrements the counter of the latch. + * Notifies all waiting threads when count reaches zero. * * @return void */ Mono countDown(); /** - * Returns the current count. - * - *

This method is typically used for debugging and testing purposes. + * Returns value of current count. * * @return the current count */ diff --git a/redisson/src/main/java/org/redisson/api/RCountDownLatchRx.java b/redisson/src/main/java/org/redisson/api/RCountDownLatchRx.java index c9a797477..34e88cb8f 100644 --- a/redisson/src/main/java/org/redisson/api/RCountDownLatchRx.java +++ b/redisson/src/main/java/org/redisson/api/RCountDownLatchRx.java @@ -21,7 +21,7 @@ import io.reactivex.Single; import java.util.concurrent.TimeUnit; /** - * RxJava2 interface of {@link java.util.concurrent.CountDownLatch} + * RxJava2 interface of Redis based {@link java.util.concurrent.CountDownLatch} * * It has an advantage over {@link java.util.concurrent.CountDownLatch} -- * count can be set via {@link #trySetCount} method. @@ -32,63 +32,33 @@ import java.util.concurrent.TimeUnit; public interface RCountDownLatchRx extends RObjectRx { /** - * Causes the current thread to wait until the latch has counted down to - * zero. + * Waits until counter reach zero. * - *

If the current count is zero then this method returns immediately. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDown} method. + * @return void * */ Completable await(); /** - * Causes the current thread to wait until the latch has counted down to - * zero or the specified waiting time elapses. - * - *

If the current count is zero then this method returns immediately - * with the value {@code true}. - * - *

If the current count is greater than zero then the current - * thread becomes disabled for thread scheduling purposes and lies - * dormant until the count reaches zero due to invocations of the - * {@link #countDown()} method or the specified waiting time elapses. - * - *

If the count reaches zero then the method returns with the - * value {@code true}. - * - *

If the specified waiting time elapses then the value {@code false} - * is returned. If the time is less than or equal to zero, the method - * will not wait at all. + * Waits until counter reach zero or up to defined timeout. * * @param waitTime the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return {@code true} if the count reached zero and {@code false} - * if the waiting time elapsed before the count reached zero + * @param unit the time unit + * @return true if the count reached zero and false + * if timeout reached before the count reached zero */ Single await(long waitTime, TimeUnit unit); /** - * Decrements the count of the latch, releasing all waiting threads if - * the count reaches zero. - * - *

If the current count is greater than zero then it is decremented. - * If the new count is zero then all waiting threads are re-enabled for - * thread scheduling purposes. - * - *

If the current count equals zero then nothing happens. + * Decrements the counter of the latch. + * Notifies all waiting threads when count reaches zero. * * @return void */ Completable countDown(); /** - * Returns the current count. - * - *

This method is typically used for debugging and testing purposes. + * Returns value of current count. * * @return the current count */