Fixes #639 - ServerContainer stores WebSocket sessions twice.

ServerContainer now delegates session storage to WebSocketServerFactory.
This commit is contained in:
Simone Bordet 2016-06-13 23:18:32 +02:00
parent 4f0741ac29
commit 77de314ce1
1 changed files with 9 additions and 2 deletions

View File

@ -19,11 +19,14 @@
package org.eclipse.jetty.websocket.jsr356.server;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;
import javax.websocket.DeploymentException;
import javax.websocket.Endpoint;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import javax.websocket.server.ServerEndpointConfig;
@ -245,14 +248,18 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
@Override
public void onSessionClosed(WebSocketSession session)
{
super.onSessionClosed(session);
webSocketServerFactory.onSessionClosed(session);
}
@Override
public void onSessionOpened(WebSocketSession session)
{
super.onSessionOpened(session);
webSocketServerFactory.onSessionOpened(session);
}
@Override
public Set<Session> getOpenSessions()
{
return new HashSet<>(webSocketServerFactory.getBeans(Session.class));
}
}