/** * Try to call {@link ReferenceCounted#release()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(); } return false; }
/** * Try to call {@link ReferenceCounted#release(int)} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg, int decrement) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(decrement); } return false; }
@Override boolean release0(int decrement) { return referenceCountDelegate.release(decrement); }
@Override boolean release0(int decrement) { return referenceCountDelegate.release(decrement); }
@Override boolean release0() { return referenceCountDelegate.release(); }
@Override boolean release0() { return referenceCountDelegate.release(); }
/** * Try to call {@link ReferenceCounted#release()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(); } return false; }
/** * Try to call {@link ReferenceCounted#release(int)} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg, int decrement) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(decrement); } return false; }
@Override boolean release0() { return referenceCountDelegate.release(); }
@Override boolean release0() { return referenceCountDelegate.release(); }
@Override boolean release0(int decrement) { return referenceCountDelegate.release(decrement); }
@Override boolean release0(int decrement) { return referenceCountDelegate.release(decrement); }
/** * Try to call {@link ReferenceCounted#release(int)} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg, int decrement) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(decrement); } return false; }
/** * Try to call {@link ReferenceCounted#release()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ public static boolean release(Object msg) { if (msg instanceof ReferenceCounted) { return ((ReferenceCounted) msg).release(); } return false; }
private void clear(int section) { final Object recordOrList = sectionAt(section); setSection(section, null); if (recordOrList instanceof ReferenceCounted) { ((ReferenceCounted) recordOrList).release(); } else if (recordOrList instanceof List) { @SuppressWarnings("unchecked") List<DnsRecord> list = (List<DnsRecord>) recordOrList; if (!list.isEmpty()) { for (Object r : list) { ReferenceCountUtil.release(r); } } } }
@Override public void run() { try { if (!obj.release(decrement)) { logger.warn("Non-zero refCnt: {}", this); } else { logger.debug("Released: {}", this); } } catch (Exception ex) { logger.warn("Failed to release an object: {}", obj, ex); } }
@Override public void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { if (!pendingUnencryptedWrites.isEmpty()) { // Check if queue is not empty first because create a new ChannelException is expensive pendingUnencryptedWrites.releaseAndFailAll(ctx, new ChannelException("Pending write on removal of SslHandler")); } pendingUnencryptedWrites = null; if (engine instanceof ReferenceCounted) { ((ReferenceCounted) engine).release(); } }
@Override public void run() { try { if (!obj.release(decrement)) { logger.warn("Non-zero refCnt: {}", this); } else { logger.debug("Released: {}", this); } } catch (Exception ex) { logger.warn("Failed to release an object: {}", obj, ex); } }
@Override public void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { if (!pendingUnencryptedWrites.isEmpty()) { // Check if queue is not empty first because create a new ChannelException is expensive pendingUnencryptedWrites.releaseAndFailAll(ctx, new ChannelException("Pending write on removal of SslHandler")); } pendingUnencryptedWrites = null; if (engine instanceof ReferenceCounted) { ((ReferenceCounted) engine).release(); } }
@Override public void run() { try { if (!obj.release(decrement)) { logger.warn("Non-zero refCnt: {}", this); } else { logger.debug("Released: {}", this); } } catch (Exception ex) { logger.warn("Failed to release an object: {}", obj, ex); } }