diff --git a/poison-pill/src/main/java/com/iluwatar/poison/pill/App.java b/poison-pill/src/main/java/com/iluwatar/poison/pill/App.java index 8f665b1e3..526ca5b86 100644 --- a/poison-pill/src/main/java/com/iluwatar/poison/pill/App.java +++ b/poison-pill/src/main/java/com/iluwatar/poison/pill/App.java @@ -1,16 +1,22 @@ package com.iluwatar.poison.pill; /** - * One of possible approaches to terminate Producer-Consumer pattern is using PoisonPill idiom. - * If you use PoisonPill as termination signal then Producer is responsible to notify Consumer that exchange is over - * and reject any further messages. Consumer receiving PoisonPill will stop to read messages from queue. - * You also must ensure that PoisonPill will be last message that will be read from queue (if you have - * prioritized queue than this can be tricky). - * In simple cases as PoisonPill can be used just null-reference, but holding unique separate shared - * object-marker (with name "Poison" or "PoisonPill") is more clear and self describing. + * One of the possible approaches to terminate Producer-Consumer pattern is using the Poison Pill idiom. + * If you use Poison Pill as the termination signal then Producer is responsible to notify Consumer that exchange is over + * and reject any further messages. Consumer receiving Poison Pill will stop reading messages from the queue. + * You must also ensure that the Poison Pill will be the last message that will be read from the queue (if you have + * prioritized queue then this can be tricky). + *

+ * In simple cases as Poison Pill can be used just null-reference, but holding unique separate shared + * object-marker (with name "Poison" or "Poison Pill") is more clear and self describing. + * */ public class App { + /** + * Program entry point + * @param args command line args + */ public static void main(String[] args) { MessageQueue queue = new SimpleMessageQueue(10000); diff --git a/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java b/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java index f306e0385..8e167790f 100644 --- a/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java +++ b/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java @@ -3,7 +3,8 @@ package com.iluwatar.poison.pill; import java.util.Map; /** - * Interface that implements the Message pattern and represents an inbound or outbound message as part of an {@link Producer}-{@link Consumer} exchange. + * Interface that implements the Message pattern and represents an inbound or outbound + * message as part of an {@link Producer}-{@link Consumer} exchange. */ public interface Message { diff --git a/poison-pill/src/test/java/com/iluwatar/poison/pill/AppTest.java b/poison-pill/src/test/java/com/iluwatar/poison/pill/AppTest.java index 625d849a2..0730e5b10 100644 --- a/poison-pill/src/test/java/com/iluwatar/poison/pill/AppTest.java +++ b/poison-pill/src/test/java/com/iluwatar/poison/pill/AppTest.java @@ -4,6 +4,11 @@ import org.junit.Test; import com.iluwatar.poison.pill.App; +/** + * + * Application test + * + */ public class AppTest { @Test