#113 Event Driven Architecture

Adds more Javadoc
This commit is contained in:
cfarrugia
2015-11-28 13:12:16 +01:00
parent fc70a706c6
commit b8b94b697a
12 changed files with 112 additions and 61 deletions
@@ -1,9 +1,11 @@
package com.iluwatar.eda.framework;
import com.iluwatar.eda.event.Event;
/**
* Channels are delivery points for messages.
* Every {@link Channel} is responsible for a single type of message
* 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);
void dispatch(E message);
}
@@ -2,10 +2,12 @@ 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.
* 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);
void registerChannel(Class<? extends E> contentType, Channel<?> channel);
void dispatch(E content);
}
@@ -1,9 +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}
* 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();
Class<? extends Message> getType();
}