Top Description Inners Fields Constructors Methods
io.netty.channel

public final Class ChannelFlushPromiseNotifier

extends Object
Class Inheritance
Imports
io.netty.util.internal.ObjectUtil, java.util.ArrayDeque, .Queue

This implementation allows to register ChannelFuture instances which will get notified once some amount of data was written and so a checkpoint was reached.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private final Queue<ChannelFlushPromiseNotifier.FlushCheckpoint>
private final boolean
private long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public ChannelFlushPromiseNotifier
add(ChannelPromise promise, int pendingDataSize)

Deprecated use add(ChannelPromise, long)
public ChannelFlushPromiseNotifier
add(ChannelPromise promise, long pendingDataSize)

Add a ChannelPromise to this ChannelFlushPromiseNotifier which will be notified after the given pendingDataSize was reached.

public ChannelFlushPromiseNotifier
increaseWriteCounter(long delta)

Increase the current write counter by the given delta

public ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier
notifyPromises()

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize is smaller after the current writeCounter returned by writeCounter().

public ChannelFlushPromiseNotifier
notifyPromises(Throwable cause)

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize isis smaller then the current writeCounter returned by writeCounter().

public ChannelFlushPromiseNotifier
notifyPromises(Throwable
the Throwable which will be used to fail all of the ChannelFutures which pendingDataSize is smaller then the current writeCounter returned by writeCounter()
cause1
,
Throwable
the Throwable which will be used to fail the remaining ChannelFutures
cause2
)

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize is smaller then the current writeCounter returned by writeCounter() using the given cause1.

private void
public long
writeCounter()

Return the current write counter of this ChannelFlushPromiseNotifier

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

flushCheckpointsback to summary
private final Queue<ChannelFlushPromiseNotifier.FlushCheckpoint> flushCheckpoints
tryNotifyback to summary
private final boolean tryNotify
writeCounterback to summary
private long writeCounter

Constructor Detail

ChannelFlushPromiseNotifierback to summary
public ChannelFlushPromiseNotifier(boolean tryNotify)

Create a new instance

Parameters
tryNotify:boolean

if true the ChannelPromises will get notified with ChannelPromise#trySuccess() and ChannelPromise#tryFailure(Throwable). Otherwise ChannelPromise#setSuccess() and ChannelPromise#setFailure(Throwable) is used

ChannelFlushPromiseNotifierback to summary
public ChannelFlushPromiseNotifier()

Create a new instance which will use ChannelPromise#setSuccess() and ChannelPromise#setFailure(Throwable) to notify the ChannelPromises.

Method Detail

addback to summary
public ChannelFlushPromiseNotifier add(ChannelPromise promise, int pendingDataSize)
Annotations
@Deprecated
addback to summary
public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize)

Add a ChannelPromise to this ChannelFlushPromiseNotifier which will be notified after the given pendingDataSize was reached.

increaseWriteCounterback to summary
public ChannelFlushPromiseNotifier increaseWriteCounter(long delta)

Increase the current write counter by the given delta

notifyFlushFuturesback to summary
public ChannelFlushPromiseNotifier notifyFlushFutures()

Deprecated

use notifyPromises()

Annotations
@Deprecated
notifyFlushFuturesback to summary
public ChannelFlushPromiseNotifier notifyFlushFutures(Throwable cause)
Annotations
@Deprecated
notifyFlushFuturesback to summary
public ChannelFlushPromiseNotifier notifyFlushFutures(Throwable cause1, Throwable cause2)
Annotations
@Deprecated
notifyPromisesback to summary
public ChannelFlushPromiseNotifier notifyPromises()

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize is smaller after the current writeCounter returned by writeCounter(). After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and so not receive anymore notification.

notifyPromisesback to summary
public ChannelFlushPromiseNotifier notifyPromises(Throwable cause)

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize isis smaller then the current writeCounter returned by writeCounter(). After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and so not receive anymore notification. The rest of the remaining ChannelFutures will be failed with the given Throwable. So after this operation this ChannelFutureListener is empty.

notifyPromisesback to summary
public ChannelFlushPromiseNotifier notifyPromises(Throwable cause1, Throwable cause2)

Notify all ChannelFutures that were registered with add(ChannelPromise, int) and their pendingDatasize is smaller then the current writeCounter returned by writeCounter() using the given cause1. After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and so not receive anymore notification. The rest of the remaining ChannelFutures will be failed with the given Throwable. So after this operation this ChannelFutureListener is empty.

Parameters
cause1:Throwable

the Throwable which will be used to fail all of the ChannelFutures which pendingDataSize is smaller then the current writeCounter returned by writeCounter()

cause2:Throwable

the Throwable which will be used to fail the remaining ChannelFutures

notifyPromises0back to summary
private void notifyPromises0(Throwable cause)
writeCounterback to summary
public long writeCounter()

Return the current write counter of this ChannelFlushPromiseNotifier

io.netty.channel back to summary

private Class ChannelFlushPromiseNotifier.DefaultFlushCheckpoint

extends Object
implements FlushCheckpoint
Class Inheritance
  • java.lang.Object
  • io.netty.channel.ChannelFlushPromiseNotifier.DefaultFlushCheckpoint
All Implemented Interfaces
io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint

Field Summary

Modifier and TypeField and Description
private long
private final ChannelPromise

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultFlushCheckpoint(long checkpoint, ChannelPromise future)

Method Summary

Modifier and TypeMethod and Description
public long
public void
public ChannelPromise
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkpointback to summary
private long checkpoint
futureback to summary
private final ChannelPromise future

Constructor Detail

DefaultFlushCheckpointback to summary
pack-priv DefaultFlushCheckpoint(long checkpoint, ChannelPromise future)

Method Detail

flushCheckpointback to summary
public long flushCheckpoint()

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.flushCheckpoint.

Annotations
@Override
flushCheckpointback to summary
public void flushCheckpoint(long checkpoint)

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.flushCheckpoint.

Annotations
@Override
promiseback to summary
public ChannelPromise promise()

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.promise.

Annotations
@Override
io.netty.channel back to summary

pack-priv Interface ChannelFlushPromiseNotifier.FlushCheckpoint

Known Direct Implementers
io.netty.channel.ChannelFlushPromiseNotifier.DefaultFlushCheckpoint, io.netty.channel.DefaultChannelProgressivePromise, io.netty.channel.DefaultChannelPromise

Method Summary

Modifier and TypeMethod and Description
public long
public void
flushCheckpoint(long checkpoint)

public ChannelPromise

Method Detail

flushCheckpointback to summary
public long flushCheckpoint()
flushCheckpointback to summary
public void flushCheckpoint(long checkpoint)
promiseback to summary
public ChannelPromise promise()