Added ChannelPipeline.isAttached()
This commit is contained in:
parent
e5c42ba3f1
commit
f6b23a000b
@ -415,6 +415,12 @@ public interface ChannelPipeline {
|
||||
*/
|
||||
void attach(Channel channel, ChannelSink sink);
|
||||
|
||||
/**
|
||||
* Returns {@code true} if and only if this pipeline is attached to
|
||||
* a {@link Channel}.
|
||||
*/
|
||||
boolean isAttached();
|
||||
|
||||
/**
|
||||
* Converts this pipeline into an ordered {@link Map} whose keys are
|
||||
* handler names and whose values are handlers.
|
||||
|
@ -99,6 +99,10 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
this.sink = sink;
|
||||
}
|
||||
|
||||
public boolean isAttached() {
|
||||
return channel != null && sink != null;
|
||||
}
|
||||
|
||||
public synchronized void addFirst(String name, ChannelHandler handler) {
|
||||
if (name2ctx.isEmpty()) {
|
||||
init(name, handler);
|
||||
|
Loading…
x
Reference in New Issue
Block a user