-// ServerEndpointConfig.Builder serverEndpointConfig = super.addingService(reference);
-// try {
-// serverContainer.addEndpoint(serverEndpointConfig.build());
-// } catch (DeploymentException e) {
-// throw new IllegalArgumentException("Cannot add end point " + reference, e);
+// System.out.println("Upgrade request cookies : " + cookies);
+// String httpSessionId = null;
+// if (cookies != null) {
+// for (HttpCookie cookie : cookies) {
+// if (cookie.getName().equals("JSESSIONID")) {
+// httpSessionId = cookie.getValue();
+// }
+// }
+// }
+//
+// if (httpSessionId == null) {
+// HttpSession httpSession = (HttpSession) upgradeRequest.getSession();
+// if (httpSession == null) {
+//// session.disconnect();
+//// return;
+// } else {
+// httpSessionId = httpSession.getId();
+// System.out.println("Upgrade request session ID : " + httpSession.getId());
+// }
+// }
+//
+// if (httpSessionId != null) {
+// int dotIdx = httpSessionId.lastIndexOf('.');
+// if (dotIdx > 0) {
+// httpSessionId = httpSessionId.substring(0, dotIdx);
+// }
+// }