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
-
Field Summary
Fields inherited from interface io.netty.channel.ChannelFutureListener
CLOSE, CLOSE_ON_FAILURE, FIRE_EXCEPTION_ON_FAILURE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.ChannelFutureawaitUninterruptibly(long timeoutMillis) Await unInterruptibly until operation is completed or time runs out.voidoperationComplete(io.netty.channel.ChannelFuture future)
-
Constructor Details
-
NettyOperationListener
public NettyOperationListener()
-
-
Method Details
-
awaitUninterruptibly
Await unInterruptibly until operation is completed or time runs out.- Parameters:
timeoutMillis- the timeout milliseconds- Returns:
- the channel future
- Throws:
Exception- the exception
-
operationComplete
- Specified by:
operationCompletein interfaceio.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>- Throws:
Exception
-