List of usage examples for io.netty.channel AddressedEnvelope retain
@Override AddressedEnvelope<M, A> retain();
From source file:io.vertx.core.dns.impl.fix.DnsQueryContext.java
License:Apache License
private void setSuccess(AddressedEnvelope<? extends DnsResponse, InetSocketAddress> envelope) { parent.queryContextManager.remove(nameServerAddr(), id); // Cancel the timeout task. final ScheduledFuture<?> timeoutFuture = this.timeoutFuture; if (timeoutFuture != null) { timeoutFuture.cancel(false);/*from w w w. j a v a 2 s .co m*/ } Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise = this.promise; if (promise.setUncancellable()) { @SuppressWarnings("unchecked") AddressedEnvelope<DnsResponse, InetSocketAddress> castResponse = (AddressedEnvelope<DnsResponse, InetSocketAddress>) envelope .retain(); promise.setSuccess(castResponse); } }