
com.ithit.webdav.integration.spring.websocket.SocketHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jakarta-integration Show documentation
Show all versions of jakarta-integration Show documentation
IT Hit WebDAV integration for new Jakarta Java servlet containers
package com.ithit.webdav.integration.spring.websocket;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public class SocketHandler extends TextWebSocketHandler {
private final List sessions = new CopyOnWriteArrayList<>();
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
sessions.add(session);
super.afterConnectionEstablished(session);
}
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
sessions.remove(session);
super.afterConnectionClosed(session, status);
}
public List getSessions() {
return sessions;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy