#113 Event Driven Architecture

- added class diagram
- added more comments
This commit is contained in:
chris
2015-11-23 11:20:20 +01:00
parent b4aeca3aa0
commit 321e9d4191
22 changed files with 123 additions and 158 deletions
@@ -0,0 +1,9 @@
package com.iluwatar.eda.framework;
/**
* Channels are delivery points for messages.
* Every {@link Channel} is responsible for a single type of message
*/
public interface Channel<E extends Message> {
void dispatch(E message);
}
@@ -0,0 +1,11 @@
package com.iluwatar.eda.framework;
/**
* A {@link DynamicRouter} is responsible for selecting the proper path of a {@link Message}
* Messages can be associated to Channels through the registerChannel method and dispatched by calling
* the dispatch method.
*/
public interface DynamicRouter<E extends Message> {
void registerChannel(Class<? extends E> contentType, Channel channel);
void dispatch(E content);
}
@@ -0,0 +1,9 @@
package com.iluwatar.eda.framework;
/**
* A {@link Message} is an object with a specific type that is associated to a
* specific {@link Channel}
*/
public interface Message {
Class<? extends Message> getType();
}