What is the usecase for having different MessageHandler objects for
different message/frame types ?
IMO, it would have been much simpler if the MessageHandler interface is
the unified handler for all types of websocket messages.
interface MessageHandler {
void onMessage(String textMessage);
void onMessage(ByteBuffer binaryMessage)
void onMessage(String textFrame,
boolean last)
void onMessage(String binaryFrame,
boolean last)
etc...
}
In this model, there will be a single MessageHandler per websocket
(Session).