Fixes #639 - ServerContainer stores WebSocket sessions twice.
ServerContainer now delegates session storage to WebSocketServerFactory.
This commit is contained in:
parent
4f0741ac29
commit
77de314ce1
|
@ -19,11 +19,14 @@
|
||||||
package org.eclipse.jetty.websocket.jsr356.server;
|
package org.eclipse.jetty.websocket.jsr356.server;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import javax.websocket.DeploymentException;
|
import javax.websocket.DeploymentException;
|
||||||
import javax.websocket.Endpoint;
|
import javax.websocket.Endpoint;
|
||||||
|
import javax.websocket.Session;
|
||||||
import javax.websocket.server.ServerEndpoint;
|
import javax.websocket.server.ServerEndpoint;
|
||||||
import javax.websocket.server.ServerEndpointConfig;
|
import javax.websocket.server.ServerEndpointConfig;
|
||||||
|
|
||||||
|
@ -245,14 +248,18 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
|
||||||
@Override
|
@Override
|
||||||
public void onSessionClosed(WebSocketSession session)
|
public void onSessionClosed(WebSocketSession session)
|
||||||
{
|
{
|
||||||
super.onSessionClosed(session);
|
|
||||||
webSocketServerFactory.onSessionClosed(session);
|
webSocketServerFactory.onSessionClosed(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSessionOpened(WebSocketSession session)
|
public void onSessionOpened(WebSocketSession session)
|
||||||
{
|
{
|
||||||
super.onSessionOpened(session);
|
|
||||||
webSocketServerFactory.onSessionOpened(session);
|
webSocketServerFactory.onSessionOpened(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Session> getOpenSessions()
|
||||||
|
{
|
||||||
|
return new HashSet<>(webSocketServerFactory.getBeans(Session.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue