javax.websocket.server.HandshakeRequest#getHttpSession ( )源码实例Demo

下面列出了javax.websocket.server.HandshakeRequest#getHttpSession ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: uyuni   文件: WebsocketSessionConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config,
        HandshakeRequest request,
        HandshakeResponse response) {
    HttpSession httpSession = (HttpSession)request.getHttpSession();
    config.getUserProperties().put("webUserID", httpSession.getAttribute("webUserID"));
}
 
@Override
public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
	HttpSession httpSession = (HttpSession) request.getHttpSession();
	if (null != httpSession) {
		config.getUserProperties().put(HttpSession.class.getName(), httpSession);
	}
}
 
源代码3 项目: mycore   文件: MCRWebsocketDefaultConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
    HttpSession httpSession = (HttpSession) request.getHttpSession();
    config.getUserProperties().put(MCRServlet.ATTR_MYCORE_SESSION,
        httpSession.getAttribute(MCRServlet.ATTR_MYCORE_SESSION));
    config.getUserProperties().put(HTTP_SESSION, httpSession);
}
 
源代码4 项目: symphonyx   文件: Channels.java
@Override
public void modifyHandshake(final ServerEndpointConfig config,
        final HandshakeRequest request, final HandshakeResponse response) {
    final HttpSession httpSession = (HttpSession) request.getHttpSession();

    config.getUserProperties().put(HttpSession.class.getName(), httpSession);
}
 
源代码5 项目: che   文件: GuiceInjectorEndpointConfigurator.java
@Override
public void modifyHandshake(
    ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
  HttpSession httpSession = (HttpSession) request.getHttpSession();
  if (httpSession != null) {
    Object sessionSubject = httpSession.getAttribute("che_subject");
    if (sessionSubject != null) {
      sec.getUserProperties().put("che_subject", sessionSubject);
    }
  }
}
 
源代码6 项目: AngularBeans   文件: GetHttpSessionConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config,
		HandshakeRequest request, HandshakeResponse response) {
	HttpSession httpSession = (HttpSession) request.getHttpSession();
	config.getUserProperties()
			.put(HttpSession.class.getName(), httpSession);
}
 
源代码7 项目: BotLibre   文件: ChatEndpointConfig.java
@Override
public void modifyHandshake(ServerEndpointConfig config, 
                            HandshakeRequest request, 
                            HandshakeResponse response)
{
    HttpSession httpSession = (HttpSession)request.getHttpSession();
    if (httpSession == null) {
    	return;
    }
    config.getUserProperties().put(HttpSession.class.getName(), httpSession);
}
 
private Configurator createConfigurator() {
    return new Configurator() {
        @Override
        public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
            super.modifyHandshake(sec, request, response);
            final HttpSession httpSession = (HttpSession)request.getHttpSession();
            if (httpSession != null) {
                sec.getUserProperties().put(HTTP_SESSION_ATTRIBUTE, httpSession);
            }
            final SecurityContext securityContext = createSecurityContext(request);
            sec.getUserProperties().put(SECURITY_CONTEXT, securityContext);
        }
    };
}
 
源代码9 项目: mcg-helper   文件: WSSHSessionConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
	HttpSession httpSession = (HttpSession)request.getHttpSession();
	config.getUserProperties().put(HttpSession.class.getName(),httpSession);
	super.modifyHandshake(config, request, response);
}
 
源代码10 项目: mcg-helper   文件: GetHttpSessionConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
	HttpSession httpSession = (HttpSession)request.getHttpSession();
	config.getUserProperties().put(HttpSession.class.getName(),httpSession);
	super.modifyHandshake(config, request, response);
}
 
源代码11 项目: realtime-log   文件: HttpSessionConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
    HttpSession httpSession = (HttpSession) request.getHttpSession();
    sec.getUserProperties().put(HttpSession.class.getName(), httpSession);
}
 
源代码12 项目: webChat   文件: SocketConfigurator.java
@Override
public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
    HttpSession httpSession = (HttpSession) request.getHttpSession();
    config.getUserProperties().put("ClientIP", httpSession.getAttribute("ClientIPadd"));//把HttpSession中保存的ClientIP放到ServerEndpointConfig中,关键字可以跟之前不同
}
 
@Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
	HttpSession httpSession = (HttpSession) request.getHttpSession();
	sec.getUserProperties().put(HttpSession.class.getName(), httpSession);
}