}
public void startWebsocket() throws Exception {
if (ui == null) throw new IllegalAccessError("start() must be called before");
final WebSocketClientFactory factory = new WebSocketClientFactory();
factory.start();
final String sessionID = jsessionID.split("=")[1];
websocketClient = factory.newWebSocketClient();
websocketClient.getCookies().put("JSESSIONID", sessionID);
websocketClient.setMaxTextMessageSize(Integer.MAX_VALUE);
websocketClient.setMaxBinaryMessageSize(Integer.MAX_VALUE);
final URI uri = new URI(url.replaceFirst("http", "ws") + "/ws" + "?" + APPLICATION.VIEW_ID + "=" + ui.viewID);