Remove isStreaming flag from AbstractHttpSockJsSession

This change removes the need for the isStreaming field from the base
class AbstractHttpSockJsSession. This field was used to account for
differences between polling vs streaming SockJS sessions without having
to expose to sub-classes private fields that are otherwise protected
from concurrent access by the base class. The change manages to delegate
to sub-classes without providing direct access to protected fields.

Issue: SPR-12427
This commit is contained in:
Rossen Stoyanchev
2014-12-09 09:47:36 -05:00
parent 7a6dfe3765
commit 43d93712f1
6 changed files with 71 additions and 39 deletions

View File

@@ -102,7 +102,7 @@ public class HttpSockJsSessionTests extends AbstractSockJsSessionTests<TestAbstr
}
static class TestAbstractHttpSockJsSession extends AbstractHttpSockJsSession {
static class TestAbstractHttpSockJsSession extends StreamingSockJsSession {
private IOException exceptionOnWriteFrame;

View File

@@ -21,6 +21,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.sockjs.SockJsTransportFailureException;
@@ -30,7 +32,7 @@ import org.springframework.web.socket.sockjs.transport.SockJsServiceConfig;
/**
* @author Rossen Stoyanchev
*/
public class TestHttpSockJsSession extends AbstractHttpSockJsSession {
public class TestHttpSockJsSession extends StreamingSockJsSession {
private boolean active;