netty/netty — Issue #116: Improve "remove" and "replace" in WebSocket handler?
Author: ngocdaothanh
Created: 2011-12-11 02:45:00+00:00
State: open

In WebSocketServerHandshaker10:

```java
ChannelPipeline p = channel.getPipeline();
p.remove("aggregator");
p.replace("decoder", "wsdecoder", new WebSocket08FrameDecoder(true, this.allowExtensions));
p.replace("encoder", "wsencoder", new WebSocket08FrameEncoder(false));
```

I think the above code doesn't work if the handlers are not named "aggregator", "decoder", and "encoder".

I think these methods should be used instead:

```java
remove(Class handlerType)
replace(Class oldHandlerType, String newName, ChannelHandler newHandler)
```

Am I correct?