framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true");
framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL,
endpoint.isUseStreaming() ? WebsocketStreamHandler.class.getName() : WebsocketHandler.class.getName());
framework.init();
WebSocketProtocol wsp = framework.getWebSocketProtocol();
if (wsp instanceof WebsocketHandler) {
((WebsocketHandler)wsp).setConsumer(this);
} else {
// this should not normally happen
LOG.error("unexpected WebSocketHandler: {}", wsp);