Madan Jampani | 890bc35 | 2014-10-01 22:35:29 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.messaging; |
| 2 | |
| 3 | import java.io.IOException; |
| 4 | |
| 5 | /** |
| 6 | * A unit of communication. |
| 7 | * Has a payload. Also supports a feature to respond back to the sender. |
| 8 | */ |
| 9 | public interface Message { |
| 10 | |
| 11 | /** |
| 12 | * Returns the payload of this message. |
| 13 | * @return message payload. |
| 14 | */ |
| 15 | public Object payload(); |
| 16 | |
| 17 | /** |
| 18 | * Sends a reply back to the sender of this messge. |
| 19 | * @param data payload of the response. |
| 20 | * @throws IOException if there is a communication error. |
| 21 | */ |
| 22 | public void respond(Object data) throws IOException; |
| 23 | } |