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