Java Code Examples for io.netty.channel.RecvByteBufAllocator#ExtendedHandle

The following examples show how to use io.netty.channel.RecvByteBufAllocator#ExtendedHandle . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Http2MultiplexCodec.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public RecvByteBufAllocator.ExtendedHandle recvBufAllocHandle() {
    if (recvHandle == null) {
        recvHandle = (RecvByteBufAllocator.ExtendedHandle) config().getRecvByteBufAllocator().newHandle();
    }
    return recvHandle;
}
 
Example 2
Source File: Http2MultiplexCodec.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public ChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
    if (!(allocator.newHandle() instanceof RecvByteBufAllocator.ExtendedHandle)) {
        throw new IllegalArgumentException("allocator.newHandle() must return an object of type: " +
                RecvByteBufAllocator.ExtendedHandle.class);
    }
    super.setRecvByteBufAllocator(allocator);
    return this;
}
 
Example 3
Source File: KQueueChannelConfig.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public KQueueChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
    if (!(allocator.newHandle() instanceof RecvByteBufAllocator.ExtendedHandle)) {
        throw new IllegalArgumentException("allocator.newHandle() must return an object of type: " +
                RecvByteBufAllocator.ExtendedHandle.class);
    }
    super.setRecvByteBufAllocator(allocator);
    return this;
}
 
Example 4
Source File: AbstractKQueueChannel.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public KQueueRecvByteAllocatorHandle recvBufAllocHandle() {
    if (allocHandle == null) {
        allocHandle = new KQueueRecvByteAllocatorHandle(
                (RecvByteBufAllocator.ExtendedHandle) super.recvBufAllocHandle());
    }
    return allocHandle;
}
 
Example 5
Source File: EpollChannelConfig.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public EpollChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
    if (!(allocator.newHandle() instanceof RecvByteBufAllocator.ExtendedHandle)) {
        throw new IllegalArgumentException("allocator.newHandle() must return an object of type: " +
                RecvByteBufAllocator.ExtendedHandle.class);
    }
    super.setRecvByteBufAllocator(allocator);
    return this;
}
 
Example 6
Source File: KQueueRecvByteAllocatorHandle.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
KQueueRecvByteAllocatorHandle(RecvByteBufAllocator.ExtendedHandle handle) {
    this.delegate = ObjectUtil.checkNotNull(handle, "handle");
}
 
Example 7
Source File: EpollRecvByteAllocatorStreamingHandle.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
public EpollRecvByteAllocatorStreamingHandle(RecvByteBufAllocator.ExtendedHandle handle) {
    super(handle);
}
 
Example 8
Source File: EpollRecvByteAllocatorHandle.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
EpollRecvByteAllocatorHandle(RecvByteBufAllocator.ExtendedHandle handle) {
    this.delegate = ObjectUtil.checkNotNull(handle, "handle");
}
 
Example 9
Source File: AbstractEpollStreamChannel.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
EpollRecvByteAllocatorHandle newEpollHandle(RecvByteBufAllocator.ExtendedHandle handle) {
    return new EpollRecvByteAllocatorStreamingHandle(handle);
}
 
Example 10
Source File: AbstractEpollChannel.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
/**
         * Create a new {@link EpollRecvByteAllocatorHandle} instance.
         * @param handle The handle to wrap with EPOLL specific logic.
         */
//
        EpollRecvByteAllocatorHandle newEpollHandle(RecvByteBufAllocator.ExtendedHandle handle) {
            return new EpollRecvByteAllocatorHandle(handle);
        }