mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-17 20:59:29 +00:00
#113 Event Driven Architecture
Adds more Javadoc and fixes checkstyle issues.
This commit is contained in:
+8
-2
@@ -1,5 +1,7 @@
|
||||
package com.iluwatar.eda.handler;
|
||||
|
||||
import com.iluwatar.eda.event.Event;
|
||||
import com.iluwatar.eda.event.UserCreatedEvent;
|
||||
import com.iluwatar.eda.event.UserUpdatedEvent;
|
||||
import com.iluwatar.eda.framework.Channel;
|
||||
|
||||
@@ -7,7 +9,11 @@ import com.iluwatar.eda.framework.Channel;
|
||||
* Handles the {@link UserUpdatedEvent} message.
|
||||
*/
|
||||
public class UserUpdatedEventHandler implements Channel<UserUpdatedEvent> {
|
||||
public void dispatch(UserUpdatedEvent message) {
|
||||
System.out.println("User Updated!");
|
||||
|
||||
@Override
|
||||
public void dispatch(Event message) {
|
||||
|
||||
UserUpdatedEvent userUpdatedEvent = (UserUpdatedEvent) message;
|
||||
System.out.printf("User with %s has been Updated!", userUpdatedEvent.getUser().getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user