X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fhandler%2Fssh%2Fvirtualsocket%2FChannelInputStream.java;h=313ea932413b63b36c5d20cc6cb1a9570205ab2a;hb=8f15fef884bc20239625850c4a2fcdaf36395526;hp=07c81b0ccb7127aad1a5ffc14a3e6d6412dd1446;hpb=9f027b8cc547e4fbd1f65e69153cac66286ab952;p=controller.git diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/ChannelInputStream.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/ChannelInputStream.java index 07c81b0ccb..313ea93241 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/ChannelInputStream.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/ChannelInputStream.java @@ -39,7 +39,9 @@ public class ChannelInputStream extends InputStream implements ChannelInboundHan b[off] = (byte)c; - if(this.bb.readableBytes() == 0) return bytesRead; + if(this.bb.readableBytes() == 0) { + return bytesRead; + } int ltr = len-1; ltr = (ltr <= bb.readableBytes()) ? ltr : bb.readableBytes(); @@ -57,6 +59,7 @@ public class ChannelInputStream extends InputStream implements ChannelInboundHan try { lock.wait(); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new RuntimeException(e); } } @@ -71,28 +74,23 @@ public class ChannelInputStream extends InputStream implements ChannelInboundHan } } - public void channelRegistered(ChannelHandlerContext ctx) - throws Exception { + public void channelRegistered(ChannelHandlerContext ctx) { ctx.fireChannelRegistered(); } - public void channelUnregistered(ChannelHandlerContext ctx) - throws Exception { + public void channelUnregistered(ChannelHandlerContext ctx) { ctx.fireChannelUnregistered(); } - public void channelActive(ChannelHandlerContext ctx) - throws Exception { + public void channelActive(ChannelHandlerContext ctx) { ctx.fireChannelActive(); } - public void channelInactive(ChannelHandlerContext ctx) - throws Exception { + public void channelInactive(ChannelHandlerContext ctx) { ctx.fireChannelInactive(); } - public void channelRead(ChannelHandlerContext ctx, Object o) - throws Exception { + public void channelRead(ChannelHandlerContext ctx, Object o) { synchronized(lock) { this.bb.discardReadBytes(); this.bb.writeBytes((ByteBuf) o); @@ -100,31 +98,25 @@ public class ChannelInputStream extends InputStream implements ChannelInboundHan } } - public void channelReadComplete(ChannelHandlerContext ctx) - throws Exception { + public void channelReadComplete(ChannelHandlerContext ctx) { ctx.fireChannelReadComplete(); } - public void userEventTriggered(ChannelHandlerContext ctx, Object o) - throws Exception { + public void userEventTriggered(ChannelHandlerContext ctx, Object o) { ctx.fireUserEventTriggered(o); } - public void channelWritabilityChanged(ChannelHandlerContext ctx) - throws Exception { + public void channelWritabilityChanged(ChannelHandlerContext ctx) { ctx.fireChannelWritabilityChanged(); } - public void handlerAdded(ChannelHandlerContext ctx) - throws Exception { + public void handlerAdded(ChannelHandlerContext ctx) { } - public void handlerRemoved(ChannelHandlerContext ctx) - throws Exception { + public void handlerRemoved(ChannelHandlerContext ctx) { } - public void exceptionCaught(ChannelHandlerContext ctx, Throwable throwable) - throws Exception { + public void exceptionCaught(ChannelHandlerContext ctx, Throwable throwable) { ctx.fireExceptionCaught(throwable); } }