#113 Event Driven Architecture

Adds unit test to assert and verify pattern behaviour
This commit is contained in:
cfarrugia
2015-11-28 17:25:15 +01:00
parent e1c0731f7e
commit 3ad36020aa
4 changed files with 61 additions and 2 deletions

View File

@ -39,4 +39,12 @@ public class EventDispatcher implements DynamicRouter<Event> {
public void dispatch(Event content) {
handlers.get(content.getClass()).dispatch(content);
}
/**
* Returns a map of registered event handlers.
* @return {@Map} of registered event handlers.
*/
public Map<Class<? extends Event>, Channel<?>> getHandlers() {
return handlers;
}
}

View File

@ -15,7 +15,6 @@ public class UserCreatedEvent extends Event {
this.user = user;
}
public User getUser() {
return user;
}