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 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.
* This App class is an example usage of Event Sourcing pattern. As an example, two bank account
+ * is created, then some money deposit and transfer actions are taken so a new state of accounts is
* created. At that point, state is cleared in order to represent a system shot down. After the shot
* down, system state is recovered by re-creating the past events from event journal. Then state is
* printed so a user can view the last state is same with the state before system shot down.
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class App {
@@ -86,10 +86,10 @@ public class App {
LOGGER.info("Do some money operations............");
eventProcessor.process(new MoneyDepositEvent(
- 2, new Date().getTime(), ACCOUNT_OF_DAENERYS, new BigDecimal("100000")));
+ 2, new Date().getTime(), ACCOUNT_OF_DAENERYS, new BigDecimal("100000")));
eventProcessor.process(new MoneyDepositEvent(
- 3, new Date().getTime(), ACCOUNT_OF_JON, new BigDecimal("100")));
+ 3, new Date().getTime(), ACCOUNT_OF_JON, new BigDecimal("100")));
eventProcessor.process(new MoneyTransferEvent(
4, new Date().getTime(), new BigDecimal("10000"), ACCOUNT_OF_DAENERYS,
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java
index 3701732ad..c037add35 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java
@@ -32,11 +32,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * This is the Account class that holds the account info, the account number,
- * account owner name and money of the account. Account class also have the business logic of events
- * that effects this account.
+ * This is the Account class that holds the account info, the account number, account owner name and
+ * money of the account. Account class also have the business logic of events that effects this
+ * account.
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class Account {
@@ -45,14 +45,15 @@ public class Account {
private final int accountNo;
private final String owner;
private BigDecimal money;
-
- private static final String MSG = "Some external api for only realtime execution could be called here.";
+
+ private static final String MSG =
+ "Some external api for only realtime execution could be called here.";
/**
* Instantiates a new Account.
*
* @param accountNo the account no
- * @param owner the owner
+ * @param owner the owner
*/
public Account(int accountNo, String owner) {
this.accountNo = accountNo;
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java
index 2f8fcabda..45751ffff 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java
@@ -27,12 +27,11 @@ import com.iluwatar.event.sourcing.domain.Account;
import com.iluwatar.event.sourcing.state.AccountAggregate;
/**
- * This is the class that implements account create event.
- * Holds the necessary info for an account create event.
- * Implements the process function that finds the event related
- * domain objects and calls the related domain object's handle event functions
+ * This is the class that implements account create event. Holds the necessary info for an account
+ * create event. Implements the process function that finds the event related domain objects and
+ * calls the related domain object's handle event functions
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class AccountCreateEvent extends DomainEvent {
@@ -42,10 +41,10 @@ public class AccountCreateEvent extends DomainEvent {
/**
* Instantiates a new Account create event.
*
- * @param sequenceId the sequence id
+ * @param sequenceId the sequence id
* @param createdTime the created time
- * @param accountNo the account no
- * @param owner the owner
+ * @param accountNo the account no
+ * @param owner the owner
*/
public AccountCreateEvent(long sequenceId, long createdTime, int accountNo, String owner) {
super(sequenceId, createdTime, "AccountCreateEvent");
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/DomainEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/DomainEvent.java
index b52a73f1b..69febd48d 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/DomainEvent.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/DomainEvent.java
@@ -28,7 +28,7 @@ import java.io.Serializable;
/**
* This is the base class for domain events. All events must extend this class.
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public abstract class DomainEvent implements Serializable {
@@ -40,8 +40,8 @@ public abstract class DomainEvent implements Serializable {
/**
* Instantiates a new Domain event.
*
- * @param sequenceId the sequence id
- * @param createdTime the created time
+ * @param sequenceId the sequence id
+ * @param createdTime the created time
* @param eventClassName the event class name
*/
public DomainEvent(long sequenceId, long createdTime, String eventClassName) {
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java
index 033421f1e..3e465c75d 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java
@@ -28,12 +28,11 @@ import com.iluwatar.event.sourcing.state.AccountAggregate;
import java.math.BigDecimal;
/**
- * This is the class that implements money deposit event.
- * Holds the necessary info for a money deposit event.
- * Implements the process function that finds the event related
- * domain objects and calls the related domain object's handle event functions
+ * This is the class that implements money deposit event. Holds the necessary info for a money
+ * deposit event. Implements the process function that finds the event related domain objects and
+ * calls the related domain object's handle event functions
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class MoneyDepositEvent extends DomainEvent {
@@ -43,10 +42,10 @@ public class MoneyDepositEvent extends DomainEvent {
/**
* Instantiates a new Money deposit event.
*
- * @param sequenceId the sequence id
+ * @param sequenceId the sequence id
* @param createdTime the created time
- * @param accountNo the account no
- * @param money the money
+ * @param accountNo the account no
+ * @param money the money
*/
public MoneyDepositEvent(long sequenceId, long createdTime, int accountNo, BigDecimal money) {
super(sequenceId, createdTime, "MoneyDepositEvent");
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java
index c39fe5eea..ccc1ac367 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java
@@ -28,12 +28,11 @@ import com.iluwatar.event.sourcing.state.AccountAggregate;
import java.math.BigDecimal;
/**
- * This is the class that implements money transfer event.
- * Holds the necessary info for a money transfer event.
- * Implements the process function that finds the event related
- * domain objects and calls the related domain object's handle event functions
+ * This is the class that implements money transfer event. Holds the necessary info for a money
+ * transfer event. Implements the process function that finds the event related domain objects and
+ * calls the related domain object's handle event functions
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class MoneyTransferEvent extends DomainEvent {
@@ -44,14 +43,14 @@ public class MoneyTransferEvent extends DomainEvent {
/**
* Instantiates a new Money transfer event.
*
- * @param sequenceId the sequence id
- * @param createdTime the created time
- * @param money the money
+ * @param sequenceId the sequence id
+ * @param createdTime the created time
+ * @param money the money
* @param accountNoFrom the account no from
- * @param accountNoTo the account no to
+ * @param accountNoTo the account no to
*/
public MoneyTransferEvent(long sequenceId, long createdTime, BigDecimal money, int accountNoFrom,
- int accountNoTo) {
+ int accountNoTo) {
super(sequenceId, createdTime, "MoneyTransferEvent");
this.money = money;
this.accountNoFrom = accountNoFrom;
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/DomainEventProcessor.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/DomainEventProcessor.java
index 50991a0c9..bf84f8369 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/DomainEventProcessor.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/DomainEventProcessor.java
@@ -26,11 +26,10 @@ package com.iluwatar.event.sourcing.processor;
import com.iluwatar.event.sourcing.event.DomainEvent;
/**
- * This is the implementation of event processor.
- * All events are processed by this class.
- * This processor uses processorJournal to persist and recover events.
+ * This is the implementation of event processor. All events are processed by this class. This
+ * processor uses processorJournal to persist and recover events.
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class DomainEventProcessor {
diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java
index 0d8b92ba7..15105dce5 100644
--- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java
+++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java
@@ -43,15 +43,14 @@ import java.util.ArrayList;
import java.util.List;
/**
- * This is the implementation of event journal.
- * This implementation serialize/deserialize the events with JSON
- * and writes/reads them on a Journal.json file at the working directory.
+ * This is the implementation of event journal. This implementation serialize/deserialize the events
+ * with JSON and writes/reads them on a Journal.json file at the working directory.
*
- * Created by Serdar Hamzaogullari on 06.08.2017.
+ * Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class JsonFileJournal {
- private final File aFile;
+ private final File file;
private final List Created by Serdar Hamzaogullari on 06.08.2017.
*/
public class AccountAggregate {
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.
*