Rename WebSocketServerHandshakeHandler to WebSocketServerProtocolHnadshakeHandler and also make it public. See #587

This commit is contained in:
norman 2012-09-10 07:15:59 +02:00
parent 4353aa6794
commit 6e39192462
3 changed files with 6 additions and 6 deletions

View File

@ -54,8 +54,8 @@ public class WebSocketServerProtocolHandler extends ChannelInboundMessageHandler
@Override
public void afterAdd(ChannelHandlerContext ctx) {
// Add the WebSocketHandshakeHandler before this one.
ctx.pipeline().addBefore(ctx.name(), WebSocketServerHandshakeHandler.class.getName(),
new WebSocketServerHandshakeHandler(websocketPath, subprotocols, allowExtensions));
ctx.pipeline().addBefore(ctx.name(), WebSocketServerProtocolHandshakeHandler.class.getName(),
new WebSocketServerProtocolHandshakeHandler(websocketPath, subprotocols, allowExtensions));
}
@Override

View File

@ -35,15 +35,15 @@ import io.netty.logging.InternalLoggerFactory;
/**
* Handles the HTTP handshake (the HTTP Upgrade request)
*/
class WebSocketServerHandshakeHandler extends ChannelInboundMessageHandlerAdapter<HttpRequest> {
public class WebSocketServerProtocolHandshakeHandler extends ChannelInboundMessageHandlerAdapter<HttpRequest> {
private static final InternalLogger logger =
InternalLoggerFactory.getInstance(WebSocketServerHandshakeHandler.class);
InternalLoggerFactory.getInstance(WebSocketServerProtocolHandshakeHandler.class);
private final String websocketPath;
private final String subprotocols;
private final boolean allowExtensions;
public WebSocketServerHandshakeHandler(String websocketPath, String subprotocols, boolean allowExtensions) {
public WebSocketServerProtocolHandshakeHandler(String websocketPath, String subprotocols, boolean allowExtensions) {
this.websocketPath = websocketPath;
this.subprotocols = subprotocols;
this.allowExtensions = allowExtensions;

View File

@ -44,7 +44,7 @@ public class WebSocketServerProtocolHandlerTest {
@Test
public void testHttpUpgradeRequest() throws Exception {
EmbeddedMessageChannel ch = createChannel(new MockOutboundHandler());
ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerHandshakeHandler.class);
ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerProtocolHandshakeHandler.class);
writeUpgradeRequest(ch);