Added ChannelHandlerContext.getChannel()
This commit is contained in:
parent
e659482215
commit
cd3c0d25c8
@ -44,6 +44,12 @@ package org.jboss.netty.channel;
|
||||
*/
|
||||
public interface ChannelHandlerContext {
|
||||
|
||||
/**
|
||||
* Returns the {@link Channel} that the {@link ChannelPipeline} belongs to.
|
||||
* This method is a shortcut to <tt>getPipeline().getChannel()</tt>.
|
||||
*/
|
||||
Channel getChannel();
|
||||
|
||||
/**
|
||||
* Returns the {@link ChannelPipeline} that the {@link ChannelHandler}
|
||||
* belongs to.
|
||||
|
@ -761,6 +761,10 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public Channel getChannel() {
|
||||
return getPipeline().getChannel();
|
||||
}
|
||||
|
||||
public ChannelPipeline getPipeline() {
|
||||
return DefaultChannelPipeline.this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user