@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
/** * Tries to call {@link ReferenceCounted#touch()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(); } return msg; }
/** * Tries to call {@link ReferenceCounted#touch(Object)} if the specified message implements * {@link ReferenceCounted}. If the specified message doesn't implement {@link ReferenceCounted}, * this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg, Object hint) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(hint); } return msg; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
/** * Tries to call {@link ReferenceCounted#touch()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(); } return msg; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
/** * Tries to call {@link ReferenceCounted#touch(Object)} if the specified message implements * {@link ReferenceCounted}. If the specified message doesn't implement {@link ReferenceCounted}, * this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg, Object hint) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(hint); } return msg; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
@Override ByteBuf touch0(Object hint) { referenceCountDelegate.touch(hint); return this; }
/** * Tries to call {@link ReferenceCounted#touch()} if the specified message implements {@link ReferenceCounted}. * If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(); } return msg; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }
/** * Tries to call {@link ReferenceCounted#touch(Object)} if the specified message implements * {@link ReferenceCounted}. If the specified message doesn't implement {@link ReferenceCounted}, * this method does nothing. */ @SuppressWarnings("unchecked") public static <T> T touch(T msg, Object hint) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).touch(hint); } return msg; }
@Override public boolean tryWrite(T obj) { requireNonNull(obj, "obj"); if (obj instanceof ReferenceCounted) { ((ReferenceCounted) obj).touch(); if (!(obj instanceof ByteBufHolder) && !(obj instanceof ByteBuf)) { throw new IllegalArgumentException( "can't publish a ReferenceCounted that's not a ByteBuf or a ByteBufHolder: " + obj); } } if (!isOpen()) { ReferenceCountUtil.safeRelease(obj); return false; } addObject(obj); return true; }
@Override ByteBuf touch0() { referenceCountDelegate.touch(); return this; }