From 5ae2ce6e2eb09c6f0c6768eea9d04aecdb4f3076 Mon Sep 17 00:00:00 2001 From: Anurag Agarwal Date: Sun, 10 Nov 2019 23:07:10 +0530 Subject: [PATCH] Resolves checkstyle errors for event-* (#1070) * Reduces checkstyle errors in event-aggregator * Reduces checkstyle errors in event-asynchronous * Reduces checkstyle errors in event-driven-architecture * Reduces checkstyle errors in event-queue * Reduces checkstyle errors in event-sourcing --- .../com/iluwatar/event/aggregator/App.java | 18 ++-- .../com/iluwatar/event/aggregator/Event.java | 2 - .../event/aggregator/EventEmitter.java | 2 - .../event/aggregator/EventObserver.java | 2 - .../event/aggregator/KingJoffrey.java | 2 - .../iluwatar/event/aggregator/KingsHand.java | 2 - .../event/aggregator/LordBaelish.java | 2 - .../iluwatar/event/aggregator/LordVarys.java | 2 - .../com/iluwatar/event/aggregator/Scout.java | 2 - .../iluwatar/event/aggregator/Weekday.java | 4 +- .../com/iluwatar/event/asynchronous/App.java | 85 ++++++++++--------- .../iluwatar/event/asynchronous/Event.java | 7 +- .../EventDoesNotExistException.java | 2 +- .../event/asynchronous/EventManager.java | 39 +++++---- .../iluwatar/event/asynchronous/IEvent.java | 3 +- .../InvalidOperationException.java | 2 +- .../LongRunningEventException.java | 2 +- .../MaxNumOfEventsAllowedException.java | 2 +- .../src/main/java/com/iluwatar/eda/App.java | 13 ++- .../com/iluwatar/eda/event/AbstractEvent.java | 11 ++- .../iluwatar/eda/event/UserCreatedEvent.java | 6 +- .../iluwatar/eda/event/UserUpdatedEvent.java | 6 +- .../com/iluwatar/eda/framework/Event.java | 9 +- .../eda/framework/EventDispatcher.java | 4 +- .../com/iluwatar/eda/framework/Handler.java | 12 +-- .../java/com/iluwatar/eda/model/User.java | 4 +- .../java/com/iluwatar/event/queue/App.java | 32 +++---- .../java/com/iluwatar/event/queue/Audio.java | 37 ++++---- .../com/iluwatar/event/queue/PlayMessage.java | 8 +- .../com/iluwatar/event/sourcing/app/App.java | 10 +-- .../event/sourcing/domain/Account.java | 15 ++-- .../sourcing/event/AccountCreateEvent.java | 15 ++-- .../event/sourcing/event/DomainEvent.java | 6 +- .../sourcing/event/MoneyDepositEvent.java | 15 ++-- .../sourcing/event/MoneyTransferEvent.java | 19 ++--- .../processor/DomainEventProcessor.java | 7 +- .../sourcing/processor/JsonFileJournal.java | 23 +++-- .../sourcing/state/AccountAggregate.java | 5 +- 38 files changed, 208 insertions(+), 229 deletions(-) diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/App.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/App.java index 421cf47b3..9e459c7a9 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/App.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/App.java @@ -27,24 +27,22 @@ import java.util.ArrayList; import java.util.List; /** - * * A system with lots of objects can lead to complexities when a client wants to subscribe to * events. The client has to find and register for each object individually, if each object has * multiple events then each event requires a separate subscription. - *

- * An Event Aggregator acts as a single source of events for many objects. It registers for all the - * events of the many objects allowing clients to register with just the aggregator. - *

- * In the example {@link LordBaelish}, {@link LordVarys} and {@link Scout} deliver events to - * {@link KingsHand}. {@link KingsHand}, the event aggregator, then delivers the events to - * {@link KingJoffrey}. * + *

An Event Aggregator acts as a single source of events for many objects. It registers for all + * the events of the many objects allowing clients to register with just the aggregator. + * + *

In the example {@link LordBaelish}, {@link LordVarys} and {@link Scout} deliver events to + * {@link KingsHand}. {@link KingsHand}, the event aggregator, then delivers the events to {@link + * KingJoffrey}. */ public class App { /** - * Program entry point - * + * Program entry point. + * * @param args command line args */ public static void main(String[] args) { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Event.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Event.java index 4227571b1..7a125c042 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Event.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Event.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * Event enumeration. - * */ public enum Event { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventEmitter.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventEmitter.java index 209d95928..eef64af1a 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventEmitter.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventEmitter.java @@ -27,9 +27,7 @@ import java.util.LinkedList; import java.util.List; /** - * * EventEmitter is the base class for event producers that can be observed. - * */ public abstract class EventEmitter { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventObserver.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventObserver.java index 45abc3217..db436b50c 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventObserver.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/EventObserver.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * Observers of events implement this interface. - * */ public interface EventObserver { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingJoffrey.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingJoffrey.java index cc76eeb73..23940c0a2 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingJoffrey.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingJoffrey.java @@ -27,9 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * * KingJoffrey observes events from {@link KingsHand}. - * */ public class KingJoffrey implements EventObserver { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingsHand.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingsHand.java index e5c77d8df..e6e05cb8d 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingsHand.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingsHand.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * KingsHand observes events from multiple sources and delivers them to listeners. - * */ public class KingsHand extends EventEmitter implements EventObserver { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordBaelish.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordBaelish.java index 216092c22..dcc01c7df 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordBaelish.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordBaelish.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * LordBaelish produces events. - * */ public class LordBaelish extends EventEmitter { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordVarys.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordVarys.java index 2d87051ff..c39080fa5 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordVarys.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/LordVarys.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * LordVarys produces events. - * */ public class LordVarys extends EventEmitter { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Scout.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Scout.java index 5dd82848a..24d6f2328 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Scout.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Scout.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * * Scout produces events. - * */ public class Scout extends EventEmitter { diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Weekday.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Weekday.java index 9c89ac343..730977bdb 100644 --- a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Weekday.java +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/Weekday.java @@ -24,9 +24,7 @@ package com.iluwatar.event.aggregator; /** - * - * Weekday enumeration - * + * Weekday enumeration. */ public enum Weekday { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/App.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/App.java index bb6f1d6ad..42b7b3391 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/App.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/App.java @@ -23,38 +23,38 @@ package com.iluwatar.event.asynchronous; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.Scanner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** + * This application demonstrates the Event-based Asynchronous pattern. Essentially, users (of + * the pattern) may choose to run events in an Asynchronous or Synchronous mode. There can be + * multiple Asynchronous events running at once but only one Synchronous event can run at a time. + * Asynchronous events are synonymous to multi-threads. The key point here is that the threads run + * in the background and the user is free to carry on with other processes. Once an event is + * complete, the appropriate listener/callback method will be called. The listener then proceeds to + * carry out further processing depending on the needs of the user. * - * This application demonstrates the Event-based Asynchronous pattern. Essentially, users (of the pattern) may - * choose to run events in an Asynchronous or Synchronous mode. There can be multiple Asynchronous events running at - * once but only one Synchronous event can run at a time. Asynchronous events are synonymous to multi-threads. The key - * point here is that the threads run in the background and the user is free to carry on with other processes. Once an - * event is complete, the appropriate listener/callback method will be called. The listener then proceeds to carry out - * further processing depending on the needs of the user. + *

The {@link EventManager} manages the events/threads that the user creates. Currently, the + * supported event operations are: start, stop, getStatus. + * For Synchronous events, the user is unable to start another (Synchronous) event if one is already + * running at the time. The running event would have to either be stopped or completed before a new + * event can be started. * - * The {@link EventManager} manages the events/threads that the user creates. Currently, the supported event operations - * are: start, stop, getStatus. For Synchronous events, the user is unable to - * start another (Synchronous) event if one is already running at the time. The running event would have to either be - * stopped or completed before a new event can be started. - * - * The Event-based Asynchronous Pattern makes available the advantages of multithreaded applications while hiding many - * of the complex issues inherent in multithreaded design. Using a class that supports this pattern can allow you to:- - * (1) Perform time-consuming tasks, such as downloads and database operations, "in the background," without - * interrupting your application. (2) Execute multiple operations simultaneously, receiving notifications when each - * completes. (3) Wait for resources to become available without stopping ("hanging") your application. (4) Communicate - * with pending asynchronous operations using the familiar events-and-delegates model. + *

The Event-based Asynchronous Pattern makes available the advantages of multithreaded + * applications while hiding many of the complex issues inherent in multithreaded design. Using a + * class that supports this pattern can allow you to:- (1) Perform time-consuming tasks, such as + * downloads and database operations, "in the background," without interrupting your application. + * (2) Execute multiple operations simultaneously, receiving notifications when each completes. (3) + * Wait for resources to become available without stopping ("hanging") your application. (4) + * Communicate with pending asynchronous operations using the familiar events-and-delegates model. * * @see EventManager * @see Event - * */ public class App { @@ -67,8 +67,7 @@ public class App { /** * Program entry point. * - * @param args - * command line args + * @param args command line args */ public static void main(String[] args) { App app = new App(); @@ -78,8 +77,9 @@ public class App { } /** - * App can run in interactive mode or not. Interactive mode == Allow user interaction with command line. - * Non-interactive is a quick sequential run through the available {@link EventManager} operations. + * App can run in interactive mode or not. Interactive mode == Allow user interaction with command + * line. Non-interactive is a quick sequential run through the available {@link EventManager} + * operations. */ public void setUp() { Properties prop = new Properties(); @@ -118,24 +118,24 @@ public class App { try { // Create an Asynchronous event. - int aEventId = eventManager.createAsync(60); - LOGGER.info("Async Event [{}] has been created.", aEventId); - eventManager.start(aEventId); - LOGGER.info("Async Event [{}] has been started.", aEventId); + int asyncEventId = eventManager.createAsync(60); + LOGGER.info("Async Event [{}] has been created.", asyncEventId); + eventManager.start(asyncEventId); + LOGGER.info("Async Event [{}] has been started.", asyncEventId); // Create a Synchronous event. - int sEventId = eventManager.create(60); - LOGGER.info("Sync Event [{}] has been created.", sEventId); - eventManager.start(sEventId); - LOGGER.info("Sync Event [{}] has been started.", sEventId); + int syncEventId = eventManager.create(60); + LOGGER.info("Sync Event [{}] has been created.", syncEventId); + eventManager.start(syncEventId); + LOGGER.info("Sync Event [{}] has been started.", syncEventId); - eventManager.status(aEventId); - eventManager.status(sEventId); + eventManager.status(asyncEventId); + eventManager.status(syncEventId); - eventManager.cancel(aEventId); - LOGGER.info("Async Event [{}] has been stopped.", aEventId); - eventManager.cancel(sEventId); - LOGGER.info("Sync Event [{}] has been stopped.", sEventId); + eventManager.cancel(asyncEventId); + LOGGER.info("Async Event [{}] has been stopped.", asyncEventId); + eventManager.cancel(syncEventId); + LOGGER.info("Sync Event [{}] has been stopped.", syncEventId); } catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException | InvalidOperationException e) { @@ -211,7 +211,8 @@ public class App { int eventId = eventManager.createAsync(eventTime); eventManager.start(eventId); LOGGER.info("Egg [{}] is being boiled.", eventId); - } catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException e) { + } catch (MaxNumOfEventsAllowedException | LongRunningEventException + | EventDoesNotExistException e) { LOGGER.error(e.getMessage()); } } else if (eventType.equalsIgnoreCase("S")) { @@ -219,8 +220,8 @@ public class App { int eventId = eventManager.create(eventTime); eventManager.start(eventId); LOGGER.info("Egg [{}] is being boiled.", eventId); - } catch (MaxNumOfEventsAllowedException | InvalidOperationException | LongRunningEventException - | EventDoesNotExistException e) { + } catch (MaxNumOfEventsAllowedException | InvalidOperationException + | LongRunningEventException | EventDoesNotExistException e) { LOGGER.error(e.getMessage()); } } else { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/Event.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/Event.java index 5c224fdac..b275b16a2 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/Event.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/Event.java @@ -27,9 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * * Each Event runs as a separate/individual thread. - * */ public class Event implements IEvent, Runnable { @@ -43,9 +41,10 @@ public class Event implements IEvent, Runnable { private ThreadCompleteListener eventListener; /** + * Constructor. * - * @param eventId event ID - * @param eventTime event time + * @param eventId event ID + * @param eventTime event time * @param isSynchronous is of synchronous type */ public Event(final int eventId, final int eventTime, final boolean isSynchronous) { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java index ed68ccfe9..fdd075d7b 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java @@ -24,7 +24,7 @@ package com.iluwatar.event.asynchronous; /** - * Custom Exception Class for Non Existent Event + * Custom Exception Class for Non Existent Event. */ public class EventDoesNotExistException extends Exception { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventManager.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventManager.java index 486030e5f..2201394d9 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventManager.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventManager.java @@ -29,29 +29,28 @@ import java.util.Random; import java.util.concurrent.ConcurrentHashMap; /** - * - * EventManager handles and maintains a pool of event threads. {@link Event} threads are created upon user request. Thre - * are two types of events; Asynchronous and Synchronous. There can be multiple Asynchronous events running at once but - * only one Synchronous event running at a time. Currently supported event operations are: start, stop, and getStatus. - * Once an event is complete, it then notifies EventManager through a listener. The EventManager then takes the event - * out of the pool. - * + * EventManager handles and maintains a pool of event threads. {@link Event} threads are created + * upon user request. Thre are two types of events; Asynchronous and Synchronous. There can be + * multiple Asynchronous events running at once but only one Synchronous event running at a time. + * Currently supported event operations are: start, stop, and getStatus. Once an event is complete, + * it then notifies EventManager through a listener. The EventManager then takes the event out of + * the pool. */ public class EventManager implements ThreadCompleteListener { - public static final int MAX_RUNNING_EVENTS = 1000; // Just don't wanna have too many running events. :) + public static final int MAX_RUNNING_EVENTS = 1000; + // Just don't wanna have too many running events. :) public static final int MIN_ID = 1; public static final int MAX_ID = MAX_RUNNING_EVENTS; public static final int MAX_EVENT_TIME = 1800; // in seconds / 30 minutes. private int currentlyRunningSyncEvent = -1; private Random rand; private Map eventPool; - + private static final String DOES_NOT_EXIST = " does not exist."; /** * EventManager constructor. - * */ public EventManager() { rand = new Random(1); @@ -65,14 +64,15 @@ public class EventManager implements ThreadCompleteListener { * @param eventTime Time an event should run for. * @return eventId * @throws MaxNumOfEventsAllowedException When too many events are running at a time. - * @throws InvalidOperationException No new synchronous events can be created when one is already running. - * @throws LongRunningEventException Long running events are not allowed in the app. + * @throws InvalidOperationException No new synchronous events can be created when one is + * already running. + * @throws LongRunningEventException Long running events are not allowed in the app. */ public int create(int eventTime) throws MaxNumOfEventsAllowedException, InvalidOperationException, LongRunningEventException { if (currentlyRunningSyncEvent != -1) { - throw new InvalidOperationException( - "Event [" + currentlyRunningSyncEvent + "] is still running. Please wait until it finishes and try again."); + throw new InvalidOperationException("Event [" + currentlyRunningSyncEvent + "] is still" + + " running. Please wait until it finishes and try again."); } int eventId = createEvent(eventTime, true); @@ -87,16 +87,18 @@ public class EventManager implements ThreadCompleteListener { * @param eventTime Time an event should run for. * @return eventId * @throws MaxNumOfEventsAllowedException When too many events are running at a time. - * @throws LongRunningEventException Long running events are not allowed in the app. + * @throws LongRunningEventException Long running events are not allowed in the app. */ - public int createAsync(int eventTime) throws MaxNumOfEventsAllowedException, LongRunningEventException { + public int createAsync(int eventTime) throws MaxNumOfEventsAllowedException, + LongRunningEventException { return createEvent(eventTime, false); } private int createEvent(int eventTime, boolean isSynchronous) throws MaxNumOfEventsAllowedException, LongRunningEventException { if (eventPool.size() == MAX_RUNNING_EVENTS) { - throw new MaxNumOfEventsAllowedException("Too many events are running at the moment. Please try again later."); + throw new MaxNumOfEventsAllowedException("Too many events are running at the moment." + + " Please try again later."); } if (eventTime >= MAX_EVENT_TIME) { @@ -185,7 +187,8 @@ public class EventManager implements ThreadCompleteListener { } /** - * Returns a pseudo-random number between min and max, inclusive. The difference between min and max can be at most + * Returns a pseudo-random number between min and max, inclusive. The difference between min and + * max can be at most * Integer.MAX_VALUE - 1. */ private int generateId() { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java index 1d451ef74..37cce70b4 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java @@ -24,8 +24,7 @@ package com.iluwatar.event.asynchronous; /** - * Events that fulfill the start stop and list out current status behaviour - * follow this interface + * Events that fulfill the start stop and list out current status behaviour follow this interface. */ public interface IEvent { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java index f439b53a8..6c0167850 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java @@ -24,7 +24,7 @@ package com.iluwatar.event.asynchronous; /** - * Type of Exception raised when the Operation being invoked is Invalid + * Type of Exception raised when the Operation being invoked is Invalid. */ public class InvalidOperationException extends Exception { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java index 76a3ecc85..aac69e312 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java @@ -24,7 +24,7 @@ package com.iluwatar.event.asynchronous; /** - * Type of Exception raised when the Operation being invoked is Long Running + * Type of Exception raised when the Operation being invoked is Long Running. */ public class LongRunningEventException extends Exception { diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java index 4e1417802..204f07dd6 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java @@ -24,7 +24,7 @@ package com.iluwatar.event.asynchronous; /** - * Type of Exception raised when the max number of allowed events is exceeded + * Type of Exception raised when the max number of allowed events is exceeded. */ public class MaxNumOfEventsAllowedException extends Exception { diff --git a/event-driven-architecture/src/main/java/com/iluwatar/eda/App.java b/event-driven-architecture/src/main/java/com/iluwatar/eda/App.java index 809bfffab..6e328e040 100644 --- a/event-driven-architecture/src/main/java/com/iluwatar/eda/App.java +++ b/event-driven-architecture/src/main/java/com/iluwatar/eda/App.java @@ -34,11 +34,11 @@ import com.iluwatar.eda.model.User; /** * An event-driven architecture (EDA) is a framework that orchestrates behavior around the * production, detection and consumption of events as well as the responses they evoke. An event is - * any identifiable occurrence that has significance for system hardware or software.

The - * example below uses an {@link EventDispatcher} to link/register {@link Event} objects to their - * respective handlers once an {@link Event} is dispatched, it's respective handler is invoked and - * the {@link Event} is handled accordingly. + * any identifiable occurrence that has significance for system hardware or software. * + *

The example below uses an {@link EventDispatcher} to link/register {@link Event} objects to + * their respective handlers once an {@link Event} is dispatched, it's respective handler is invoked + * and the {@link Event} is handled accordingly. */ public class App { @@ -47,9 +47,8 @@ public class App { * made known to the dispatcher by registering them. In this case the {@link UserCreatedEvent} is * bound to the UserCreatedEventHandler, whilst the {@link UserUpdatedEvent} is bound to the * {@link UserUpdatedEventHandler}. The dispatcher can now be called to dispatch specific events. - * When a user is saved, the {@link UserCreatedEvent} can be dispatched. - * On the other hand, when a user is updated, {@link UserUpdatedEvent} can be dispatched. - * + * When a user is saved, the {@link UserCreatedEvent} can be dispatched. On the other hand, when a + * user is updated, {@link UserUpdatedEvent} can be dispatched. */ public static void main(String[] args) { diff --git a/event-driven-architecture/src/main/java/com/iluwatar/eda/event/AbstractEvent.java b/event-driven-architecture/src/main/java/com/iluwatar/eda/event/AbstractEvent.java index 5218f4bad..011cfc3f1 100644 --- a/event-driven-architecture/src/main/java/com/iluwatar/eda/event/AbstractEvent.java +++ b/event-driven-architecture/src/main/java/com/iluwatar/eda/event/AbstractEvent.java @@ -23,12 +23,12 @@ package com.iluwatar.eda.event; -import com.iluwatar.eda.framework.EventDispatcher; import com.iluwatar.eda.framework.Event; +import com.iluwatar.eda.framework.EventDispatcher; /** - * The {@link AbstractEvent} class serves as a base class for defining custom events happening with your - * system. In this example we have two types of events defined. + * The {@link AbstractEvent} class serves as a base class for defining custom events happening with + * your system. In this example we have two types of events defined. *