Skip to content

Commit f561499

Browse files
committed
server-side of the MessageImpl class to be passed to ServerMessageListeners
1 parent dd4248f commit f561499

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package listener_references;
2+
3+
/**
4+
* The {@link ServerMessage} object to be passed to a {@link listeners.ServerMessageListener}
5+
*/
6+
public class ServerMessage extends MessageImpl {
7+
8+
protected final ServerConnection connection;
9+
10+
/**
11+
* Constructs a new {@link ServerMessage}
12+
* @param message the message
13+
* @param connection the {@link ServerConnection} the message was received from
14+
*/
15+
public ServerMessage(String message, ServerConnection connection) {
16+
super(message);
17+
this.connection = connection;
18+
}
19+
20+
/**
21+
* @return the {@link ServerConnection} the message was received from
22+
*/
23+
@Override
24+
public ServerConnection getConnection() {
25+
return connection;
26+
}
27+
}

0 commit comments

Comments
 (0)