protected static ByteBuf toLeakAwareBuffer(ByteBuf buf) { ResourceLeak leak; switch (ResourceLeakDetector.getLevel()) { case SIMPLE: leak = AbstractByteBuf.leakDetector.open(buf); if (leak != null) { buf = new SimpleLeakAwareByteBuf(buf, leak); } break; case ADVANCED: case PARANOID: leak = AbstractByteBuf.leakDetector.open(buf); if (leak != null) { buf = new AdvancedLeakAwareByteBuf(buf, leak); } break; } return buf; }
AdvancedLeakAwareByteBuf(ByteBuf buf, ResourceLeak leak) { super(buf); this.leak = leak; }
SimpleLeakAwareByteBuf(ByteBuf buf, ResourceLeak leak) { super(buf); this.leak = leak; }
ResourceLeak getLeak() { return leak; }