Class NettyOperationListener

java.lang.Object
org.serviceconnector.net.req.netty.NettyOperationListener
All Implemented Interfaces:
io.netty.channel.ChannelFutureListener, io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>, EventListener

public class NettyOperationListener extends Object implements io.netty.channel.ChannelFutureListener
The Class NettyOperationListener. Used to wait until operation us successfully done by netty framework. BlockingQueue is used for synchronization and waiting mechanism. Communication Exception is thrown when operation fails. BlockingQueue only holds newest answer.
Author:
JTraber
  • Constructor Details

    • NettyOperationListener

      public NettyOperationListener()
  • Method Details

    • awaitUninterruptibly

      public io.netty.channel.ChannelFuture awaitUninterruptibly(long timeoutMillis) throws Exception
      Await unInterruptibly until operation is completed or time runs out.
      Parameters:
      timeoutMillis - the timeout milliseconds
      Returns:
      the channel future
      Throws:
      Exception - the exception
    • operationComplete

      public void operationComplete(io.netty.channel.ChannelFuture future) throws Exception
      Specified by:
      operationComplete in interface io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>
      Throws:
      Exception