Top Inners Fields Constructors Methods
io.netty5.channel

public Class MaxMessagesWriteHandleFactory

extends Object
implements WriteHandleFactory
Class Inheritance
All Implemented Interfaces
io.netty5.channel.WriteHandleFactory
Known Direct Subclasses
io.netty5.channel.socket.SocketChannelWriteHandleFactory
Static Imports
io.netty5.util.internal.ObjectUtil.checkPositive

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
public
MaxMessagesWriteHandleFactory(int maxMessagesPerWrite)

Method Summary

Modifier and TypeMethod and Description
public final WriteHandleFactory.WriteHandle
newHandle(Channel
the Channel for which the WriteHandle is used.
channel
)

Implements io.netty5.channel.WriteHandleFactory.newHandle.

Creates a new handle for the given Channel.
protected MaxMessagesWriteHandleFactory.MaxMessagesWriteHandle
newHandle(Channel channel, int maxMessagesPerWrite)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxMessagesPerWriteback to summary
private final int maxMessagesPerWrite

Constructor Detail

MaxMessagesWriteHandleFactoryback to summary
public MaxMessagesWriteHandleFactory(int maxMessagesPerWrite)

Method Detail

newHandleback to summary
public final WriteHandleFactory.WriteHandle newHandle(Channel channel)

Implements io.netty5.channel.WriteHandleFactory.newHandle.

Doc from io.netty5.channel.WriteHandleFactory.newHandle.

Creates a new handle for the given Channel.

Parameters
channel:Channel

the Channel for which the WriteHandle is used.

Annotations
@Override
newHandleback to summary
protected MaxMessagesWriteHandleFactory.MaxMessagesWriteHandle newHandle(Channel channel, int maxMessagesPerWrite)
io.netty5.channel back to summary

protected Class MaxMessagesWriteHandleFactory.MaxMessagesWriteHandle

extends Object
implements WriteHandle
Class Inheritance
  • java.lang.Object
  • io.netty5.channel.MaxMessagesWriteHandleFactory.MaxMessagesWriteHandle
All Implemented Interfaces
io.netty5.channel.WriteHandleFactory.WriteHandle
Known Direct Subclasses
io.netty5.channel.socket.SocketChannelWriteHandleFactory.SndBufferWriteHandle

Field Summary

Modifier and TypeField and Description
private final int
private int

Constructor Summary

AccessConstructor and Description
protected
MaxMessagesWriteHandle(int maxMessagesPerWrite)

Method Summary

Modifier and TypeMethod and Description
public boolean
lastWrite(long
The number of bytes the write operation did attempt to write.
attemptedBytesWrite
,
long
The number of bytes from the previous write operation. This may be negative if a write error occurs.
actualBytesWrite
,
int
The number of messages written.
numMessagesWrite
)

Implements io.netty5.channel.WriteHandleFactory.WriteHandle.lastWrite.

Notify the WriteHandle of the last write operation and its result.
public void
writeComplete()

Implements io.netty5.channel.WriteHandleFactory.WriteHandle.writeComplete.

Method that must be called once the write loop was completed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxMessagesPerWriteback to summary
private final int maxMessagesPerWrite
totalNumMessagesback to summary
private int totalNumMessages

Constructor Detail

MaxMessagesWriteHandleback to summary
protected MaxMessagesWriteHandle(int maxMessagesPerWrite)

Method Detail

lastWriteback to summary
public boolean lastWrite(long attemptedBytesWrite, long actualBytesWrite, int numMessagesWrite)

Implements io.netty5.channel.WriteHandleFactory.WriteHandle.lastWrite.

Doc from io.netty5.channel.WriteHandleFactory.WriteHandle.lastWrite.

Notify the WriteHandle of the last write operation and its result.

Parameters
attemptedBytesWrite:long

The number of bytes the write operation did attempt to write.

actualBytesWrite:long

The number of bytes from the previous write operation. This may be negative if a write error occurs.

numMessagesWrite:int

The number of messages written.

Returns:boolean

true if the write loop should continue writing, false otherwise.

Annotations
@Override
writeCompleteback to summary
public void writeComplete()

Implements io.netty5.channel.WriteHandleFactory.WriteHandle.writeComplete.

Doc from io.netty5.channel.WriteHandleFactory.WriteHandle.writeComplete.

Method that must be called once the write loop was completed.

Annotations
@Override