Change ReferenceCounted.retain* to return itself and so allow method chaining
This commit is contained in:
parent
53c27ef5ae
commit
5370573400
@ -28,10 +28,14 @@ public abstract class AbstractDerivedByteBuf extends AbstractByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain() { }
|
public final ByteBuf retain() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain(int increment) { }
|
public final ByteBuf retain(int increment) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean release() {
|
public final boolean release() {
|
||||||
|
@ -42,7 +42,7 @@ public abstract class AbstractMessageBuf<T> extends AbstractQueue<T> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain() {
|
public final MessageBuf<T> retain() {
|
||||||
int refCnt = this.refCnt;
|
int refCnt = this.refCnt;
|
||||||
if (refCnt <= 0) {
|
if (refCnt <= 0) {
|
||||||
throw new IllegalBufferAccessException();
|
throw new IllegalBufferAccessException();
|
||||||
@ -53,10 +53,11 @@ public abstract class AbstractMessageBuf<T> extends AbstractQueue<T> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.refCnt = refCnt + 1;
|
this.refCnt = refCnt + 1;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain(int increment) {
|
public final MessageBuf<T> retain(int increment) {
|
||||||
if (increment <= 0) {
|
if (increment <= 0) {
|
||||||
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
||||||
}
|
}
|
||||||
@ -71,6 +72,7 @@ public abstract class AbstractMessageBuf<T> extends AbstractQueue<T> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.refCnt = refCnt + 1;
|
this.refCnt = refCnt + 1;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,7 +31,7 @@ public abstract class AbstractReferenceCounted implements ReferenceCounted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain() {
|
public ReferenceCounted retain() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int refCnt = this.refCnt;
|
int refCnt = this.refCnt;
|
||||||
if (refCnt == 0) {
|
if (refCnt == 0) {
|
||||||
@ -44,10 +44,11 @@ public abstract class AbstractReferenceCounted implements ReferenceCounted {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain(int increment) {
|
public ReferenceCounted retain(int increment) {
|
||||||
if (increment <= 0) {
|
if (increment <= 0) {
|
||||||
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
||||||
}
|
}
|
||||||
@ -64,6 +65,7 @@ public abstract class AbstractReferenceCounted implements ReferenceCounted {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,7 +36,7 @@ public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain() {
|
public ByteBuf retain() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int refCnt = this.refCnt;
|
int refCnt = this.refCnt;
|
||||||
if (refCnt == 0) {
|
if (refCnt == 0) {
|
||||||
@ -49,10 +49,11 @@ public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void retain(int increment) {
|
public ByteBuf retain(int increment) {
|
||||||
if (increment <= 0) {
|
if (increment <= 0) {
|
||||||
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
throw new IllegalArgumentException("increment: " + increment + " (expected: > 0)");
|
||||||
}
|
}
|
||||||
@ -69,6 +70,7 @@ public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,4 +49,10 @@ public interface Buf extends ReferenceCounted {
|
|||||||
* elements.
|
* elements.
|
||||||
*/
|
*/
|
||||||
boolean isWritable(int size);
|
boolean isWritable(int size);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Buf retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Buf retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -1915,4 +1915,10 @@ public interface ByteBuf extends Buf, Comparable<ByteBuf> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
String toString();
|
String toString();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
ByteBuf retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
ByteBuf retain();
|
||||||
}
|
}
|
||||||
|
@ -30,4 +30,10 @@ public interface ByteBufHolder extends ReferenceCounted {
|
|||||||
* Create a deep copy of this {@link ByteBufHolder}.
|
* Create a deep copy of this {@link ByteBufHolder}.
|
||||||
*/
|
*/
|
||||||
ByteBufHolder copy();
|
ByteBufHolder copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
ByteBufHolder retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
ByteBufHolder retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -374,4 +374,10 @@ public interface CompositeByteBuf extends ByteBuf, Iterable<ByteBuf> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
CompositeByteBuf resumeIntermediaryDeallocations();
|
CompositeByteBuf resumeIntermediaryDeallocations();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
CompositeByteBuf retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
CompositeByteBuf retain();
|
||||||
}
|
}
|
||||||
|
@ -53,13 +53,15 @@ public class DefaultByteBufHolder implements ByteBufHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public ByteBufHolder retain() {
|
||||||
data.retain();
|
data.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public ByteBufHolder retain(int increment) {
|
||||||
data.retain(increment);
|
data.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,7 +40,8 @@ import java.util.Queue;
|
|||||||
* is recommended to use {@link Unpooled#wrappedBuffer(ByteBuf...)}
|
* is recommended to use {@link Unpooled#wrappedBuffer(ByteBuf...)}
|
||||||
* instead of calling the constructor explicitly.
|
* instead of calling the constructor explicitly.
|
||||||
*/
|
*/
|
||||||
public class DefaultCompositeByteBuf extends AbstractReferenceCountedByteBuf implements CompositeByteBuf {
|
public class DefaultCompositeByteBuf extends AbstractReferenceCountedByteBuf
|
||||||
|
implements CompositeByteBuf {
|
||||||
|
|
||||||
private static final ByteBuffer[] EMPTY_NIOBUFFERS = new ByteBuffer[0];
|
private static final ByteBuffer[] EMPTY_NIOBUFFERS = new ByteBuffer[0];
|
||||||
|
|
||||||
@ -1514,6 +1515,16 @@ public class DefaultCompositeByteBuf extends AbstractReferenceCountedByteBuf imp
|
|||||||
return (CompositeByteBuf) super.writeZero(length);
|
return (CompositeByteBuf) super.writeZero(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompositeByteBuf retain(int increment) {
|
||||||
|
return (CompositeByteBuf) super.retain(increment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompositeByteBuf retain() {
|
||||||
|
return (CompositeByteBuf) super.retain();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByteBuffer[] nioBuffers() {
|
public ByteBuffer[] nioBuffers() {
|
||||||
return nioBuffers(readerIndex(), readableBytes());
|
return nioBuffers(readerIndex(), readableBytes());
|
||||||
|
@ -809,10 +809,14 @@ public final class EmptyByteBuf implements ByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() { }
|
public ByteBuf retain() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) { }
|
public ByteBuf retain(int increment) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean release() {
|
public boolean release() {
|
||||||
|
@ -205,13 +205,15 @@ public abstract class FilteredMessageBuf implements MessageBuf<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public MessageBuf<Object> retain() {
|
||||||
buf.retain();
|
buf.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public MessageBuf<Object> retain(int increment) {
|
||||||
buf.retain(increment);
|
buf.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,4 +54,10 @@ public interface MessageBuf<T> extends Buf, Queue<T> {
|
|||||||
* @return number the number of objects which was transfered
|
* @return number the number of objects which was transfered
|
||||||
*/
|
*/
|
||||||
int drainTo(Collection<? super T> c, int maxElements);
|
int drainTo(Collection<? super T> c, int maxElements);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
MessageBuf<T> retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
MessageBuf<T> retain();
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,12 @@ public interface ReferenceCounted {
|
|||||||
/**
|
/**
|
||||||
* Increases the reference count by {@code 1}.
|
* Increases the reference count by {@code 1}.
|
||||||
*/
|
*/
|
||||||
void retain();
|
ReferenceCounted retain();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increases the reference count by the specified {@code increment}.
|
* Increases the reference count by the specified {@code increment}.
|
||||||
*/
|
*/
|
||||||
void retain(int increment);
|
ReferenceCounted retain(int increment);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decreases the reference count by {@code 1} and deallocates this object if the reference count reaches at
|
* Decreases the reference count by {@code 1} and deallocates this object if the reference count reaches at
|
||||||
|
@ -821,13 +821,15 @@ public final class SwappedByteBuf implements ByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public ByteBuf retain() {
|
||||||
buf.retain();
|
buf.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public ByteBuf retain(int increment) {
|
||||||
buf.retain(increment);
|
buf.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,13 +53,15 @@ public class DefaultFullHttpRequest extends DefaultHttpRequest implements FullHt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public FullHttpRequest retain() {
|
||||||
content.retain();
|
content.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public FullHttpRequest retain(int increment) {
|
||||||
content.retain(increment);
|
content.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,13 +55,15 @@ public class DefaultFullHttpResponse extends DefaultHttpResponse implements Full
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public FullHttpResponse retain() {
|
||||||
content.retain();
|
content.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public FullHttpResponse retain(int increment) {
|
||||||
content.retain(increment);
|
content.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,13 +50,15 @@ public class DefaultHttpContent extends DefaultHttpObject implements HttpContent
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public HttpContent retain() {
|
||||||
content.retain();
|
content.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public HttpContent retain(int increment) {
|
||||||
content.retain(increment);
|
content.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,6 +54,18 @@ public class DefaultLastHttpContent extends DefaultHttpContent implements LastHt
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LastHttpContent retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LastHttpContent retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpHeaders trailingHeaders() {
|
public HttpHeaders trailingHeaders() {
|
||||||
return trailingHeaders;
|
return trailingHeaders;
|
||||||
|
@ -23,4 +23,9 @@ public interface FullHttpMessage extends HttpMessage, LastHttpContent {
|
|||||||
@Override
|
@Override
|
||||||
FullHttpMessage copy();
|
FullHttpMessage copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpMessage retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpMessage retain();
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,12 @@ public interface FullHttpRequest extends HttpRequest, FullHttpMessage {
|
|||||||
@Override
|
@Override
|
||||||
FullHttpRequest copy();
|
FullHttpRequest copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpRequest retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpRequest retain();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
FullHttpRequest setProtocolVersion(HttpVersion version);
|
FullHttpRequest setProtocolVersion(HttpVersion version);
|
||||||
|
|
||||||
|
@ -23,6 +23,12 @@ public interface FullHttpResponse extends HttpResponse, FullHttpMessage {
|
|||||||
@Override
|
@Override
|
||||||
FullHttpResponse copy();
|
FullHttpResponse copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpResponse retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FullHttpResponse retain();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
FullHttpResponse setProtocolVersion(HttpVersion version);
|
FullHttpResponse setProtocolVersion(HttpVersion version);
|
||||||
|
|
||||||
|
@ -30,4 +30,10 @@ import io.netty.channel.ChannelPipeline;
|
|||||||
public interface HttpContent extends HttpObject, ByteBufHolder {
|
public interface HttpContent extends HttpObject, ByteBufHolder {
|
||||||
@Override
|
@Override
|
||||||
HttpContent copy();
|
HttpContent copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HttpContent retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HttpContent retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -129,12 +129,10 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
|
|||||||
Result result = beginEncode(message, c, acceptEncoding);
|
Result result = beginEncode(message, c, acceptEncoding);
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
ByteBuf data = c.data();
|
|
||||||
data.retain();
|
|
||||||
if (c instanceof LastHttpContent) {
|
if (c instanceof LastHttpContent) {
|
||||||
return new Object[] { message, new DefaultLastHttpContent(data) };
|
return new Object[] { message, new DefaultLastHttpContent(c.data().retain()) };
|
||||||
} else {
|
} else {
|
||||||
return new Object[] { message, new DefaultHttpContent(data) };
|
return new Object[] { message, new DefaultHttpContent(c.data().retain()) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,10 +60,14 @@ public interface LastHttpContent extends HttpContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() { }
|
public LastHttpContent retain() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) { }
|
public LastHttpContent retain(int increment) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean release() {
|
public boolean release() {
|
||||||
@ -80,4 +84,10 @@ public interface LastHttpContent extends HttpContent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
LastHttpContent copy();
|
LastHttpContent copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
LastHttpContent retain(int increment);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
LastHttpContent retain();
|
||||||
}
|
}
|
||||||
|
@ -114,4 +114,16 @@ public abstract class AbstractHttpData extends AbstractReferenceCounted implemen
|
|||||||
protected void deallocate() {
|
protected void deallocate() {
|
||||||
delete();
|
delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpData retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpData retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,4 +33,10 @@ public interface Attribute extends HttpData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
Attribute copy();
|
Attribute copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Attribute retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Attribute retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class DiskAttribute extends AbstractDiskHttpData implements Attribute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DiskAttribute copy() {
|
public Attribute copy() {
|
||||||
DiskAttribute attr = new DiskAttribute(getName());
|
DiskAttribute attr = new DiskAttribute(getName());
|
||||||
attr.setCharset(getCharset());
|
attr.setCharset(getCharset());
|
||||||
ByteBuf content = data();
|
ByteBuf content = data();
|
||||||
@ -154,4 +154,16 @@ public class DiskAttribute extends AbstractDiskHttpData implements Attribute {
|
|||||||
}
|
}
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Attribute retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Attribute retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ public class DiskFileUpload extends AbstractDiskHttpData implements FileUpload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DiskFileUpload copy() {
|
public FileUpload copy() {
|
||||||
DiskFileUpload upload = new DiskFileUpload(getName(),
|
DiskFileUpload upload = new DiskFileUpload(getName(),
|
||||||
getFilename(), getContentType(), getContentTransferEncoding(), getCharset(), size);
|
getFilename(), getContentType(), getContentTransferEncoding(), getCharset(), size);
|
||||||
ByteBuf buf = data();
|
ByteBuf buf = data();
|
||||||
@ -177,4 +177,16 @@ public class DiskFileUpload extends AbstractDiskHttpData implements FileUpload {
|
|||||||
}
|
}
|
||||||
return upload;
|
return upload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,4 +58,10 @@ public interface FileUpload extends HttpData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
FileUpload copy();
|
FileUpload copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FileUpload retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
FileUpload retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -179,4 +179,10 @@ public interface HttpData extends InterfaceHttpData, ByteBufHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
HttpData copy();
|
HttpData copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HttpData retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HttpData retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ public class MemoryAttribute extends AbstractMemoryHttpData implements Attribute
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryAttribute copy() {
|
public Attribute copy() {
|
||||||
MemoryAttribute attr = new MemoryAttribute(getName());
|
MemoryAttribute attr = new MemoryAttribute(getName());
|
||||||
attr.setCharset(getCharset());
|
attr.setCharset(getCharset());
|
||||||
ByteBuf content = data();
|
ByteBuf content = data();
|
||||||
@ -115,4 +115,16 @@ public class MemoryAttribute extends AbstractMemoryHttpData implements Attribute
|
|||||||
}
|
}
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Attribute retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Attribute retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public class MemoryFileUpload extends AbstractMemoryHttpData implements FileUplo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryFileUpload copy() {
|
public FileUpload copy() {
|
||||||
MemoryFileUpload upload = new MemoryFileUpload(getName(), getFilename(), getContentType(),
|
MemoryFileUpload upload = new MemoryFileUpload(getName(), getFilename(), getContentType(),
|
||||||
getContentTransferEncoding(), getCharset(), size);
|
getContentTransferEncoding(), getCharset(), size);
|
||||||
ByteBuf buf = data();
|
ByteBuf buf = data();
|
||||||
@ -144,4 +144,16 @@ public class MemoryFileUpload extends AbstractMemoryHttpData implements FileUplo
|
|||||||
}
|
}
|
||||||
return upload;
|
return upload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,13 +215,15 @@ public class MixedAttribute implements Attribute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public Attribute retain() {
|
||||||
attribute.retain();
|
attribute.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public Attribute retain(int increment) {
|
||||||
attribute.retain(increment);
|
attribute.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -241,13 +241,15 @@ public class MixedFileUpload implements FileUpload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public FileUpload retain() {
|
||||||
fileUpload.retain();
|
fileUpload.retain();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public FileUpload retain(int increment) {
|
||||||
fileUpload.retain(increment);
|
fileUpload.retain(increment);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -89,6 +89,18 @@ public class DefaultSpdyDataFrame extends DefaultByteBufHolder implements SpdyDa
|
|||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SpdyDataFrame retain() {
|
||||||
|
super.retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SpdyDataFrame retain(int increment) {
|
||||||
|
super.retain(increment);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
|
@ -41,4 +41,10 @@ public interface SpdyDataFrame extends ByteBufHolder, SpdyStreamFrame, SpdyDataO
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
SpdyDataFrame copy();
|
SpdyDataFrame copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
SpdyDataFrame retain();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
SpdyDataFrame retain(int increment);
|
||||||
}
|
}
|
||||||
|
@ -884,12 +884,12 @@ final class ReplayingDecoderBuffer implements ByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public ByteBuf retain() {
|
||||||
throw new UnreplayableOperationException();
|
throw new UnreplayableOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public ByteBuf retain(int increment) {
|
||||||
throw new UnreplayableOperationException();
|
throw new UnreplayableOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,13 +128,15 @@ public class DefaultChannelPipelineTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain() {
|
public ReferenceCounted retain() {
|
||||||
fail();
|
fail();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void retain(int increment) {
|
public ReferenceCounted retain(int increment) {
|
||||||
fail();
|
fail();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user