blob: 54b95260d33dea07bc8c9631bcd462a8d95896d7 [file] [log] [blame]
Madan Jampanic9ed9be2014-10-02 16:13:11 -07001package org.onlab.netty;
Madan Jampani890bc352014-10-01 22:35:29 -07002
3import 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 */
9public 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}