Code Review
/
netconf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Hide Netty(Pipeline)AwareChannelSubsystem
[netconf.git]
/
netconf
/
netconf-netty-util
/
src
/
main
/
java
/
org
/
opendaylight
/
netconf
/
nettyutil
/
handler
/
ssh
/
client
/
NetconfClientSessionImpl.java
diff --git
a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfClientSessionImpl.java
b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfClientSessionImpl.java
index 1a465d888765608fe7a4f8823b6ad8d430ad7ff0..0f8435235a0506172a56ea8e6bf4d4b1ade08bef 100644
(file)
--- a/
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfClientSessionImpl.java
+++ b/
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfClientSessionImpl.java
@@
-7,6
+7,8
@@
*/
package org.opendaylight.netconf.nettyutil.handler.ssh.client;
*/
package org.opendaylight.netconf.nettyutil.handler.ssh.client;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.Beta;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import com.google.common.annotations.Beta;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
@@
-27,18
+29,30
@@
public final class NetconfClientSessionImpl extends ClientSessionImpl implements
}
@Override
}
@Override
- public
NettyAware
ChannelSubsystem createSubsystemChannel(final String subsystem, final ChannelHandlerContext ctx)
+ public ChannelSubsystem createSubsystemChannel(final String subsystem, final ChannelHandlerContext ctx)
throws IOException {
throws IOException {
- return registerSubsystem(new NettyAwareChannelSubsystem(subsystem, ctx));
+ requireNonNull(ctx);
+ return registerSubsystem(new NettyChannelSubsystem(subsystem) {
+ @Override
+ ChannelHandlerContext context() {
+ return ctx;
+ }
+ });
}
@Override
}
@Override
- public
NettyPipelineAware
ChannelSubsystem createSubsystemChannel(final String subsystem,
+ public ChannelSubsystem createSubsystemChannel(final String subsystem,
final ChannelPipeline pipeline) throws IOException {
final ChannelPipeline pipeline) throws IOException {
- return registerSubsystem(new NettyPipelineAwareChannelSubsystem(subsystem, pipeline));
+ requireNonNull(pipeline);
+ return registerSubsystem(new NettyChannelSubsystem(subsystem) {
+ @Override
+ ChannelHandlerContext context() {
+ return pipeline.firstContext();
+ }
+ });
}
}
- private
<T extends ChannelSubsystem> T registerSubsystem(final T
subsystem) throws IOException {
+ private
ChannelSubsystem registerSubsystem(final ChannelSubsystem
subsystem) throws IOException {
final var service = getConnectionService();
final var id = service.registerChannel(subsystem);
if (log.isDebugEnabled()) {
final var service = getConnectionService();
final var id = service.registerChannel(subsystem);
if (log.isDebugEnabled()) {