Merge "BUG-2982 : moved path-attributes container to grouping"
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / ChannelOutputLimiter.java
index 4ea3f54a28320ae15b3a5137f2841575d0dfa58e..3a610b6221eb725b8c80bd0d08d9fae15728d72c 100644 (file)
@@ -29,7 +29,7 @@ final class ChannelOutputLimiter extends ChannelInboundHandlerAdapter {
         this.session = Preconditions.checkNotNull(session);
     }
 
-    void write(final Notification msg) {
+    private void ensureWritable() {
         if (blocked) {
             LOG.trace("Blocked slow path tripped on session {}", session);
             synchronized (this) {
@@ -45,12 +45,20 @@ final class ChannelOutputLimiter extends ChannelInboundHandlerAdapter {
                 LOG.debug("Resuming write on session {}", session);
             }
         }
+    }
+
+    void write(final Notification msg) {
+        ensureWritable();
+        session.write(msg);
+    }
 
-        session.sendMessage(msg);
+    void writeAndFlush(final Notification msg) {
+        ensureWritable();
+        session.writeAndFlush(msg);
     }
 
     void flush() {
-        // FIXME: no-op, as we do not have hatching APIs in session yet
+        session.flush();
     }
 
     @Override