Top Description Inners Fields Constructors Methods
io.netty5.channel.group

pack-priv final Class DefaultChannelGroupFuture

extends DefaultPromise<Void>
implements ChannelGroupFuture
Class Inheritance
All Implemented Interfaces
io.netty5.channel.group.ChannelGroupFuture, java.lang.Iterable, io.netty5.util.concurrent.Future, io.netty5.util.concurrent.AsynchronousResult
Imports
io.netty5.channel.Channel, io.netty5.util.concurrent.BlockingOperationException, .DefaultPromise, .EventExecutor, .Future, .FutureListener, .ImmediateEventExecutor, java.util.ArrayList, .Collections, .Iterator, .List, .Map, .Map.Entry

The default ChannelGroupFuture implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final FutureListener<Void>
private int
private final Map<Channel, Future<Void>>
private final ChannelGroup
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public DefaultChannelGroupFuture
addListener(FutureListener<? super Void>
The listener to be called when this future completes. The listener will be passed this future as an argument.
listener
)

Overrides io.netty5.util.concurrent.DefaultPromise.addListener.

Implements io.netty5.channel.group.ChannelGroupFuture.addListener, io.netty5.util.concurrent.Future.addListener.

Adds the specified listener to this future.
public DefaultChannelGroupFuture
public ChannelGroupException
protected void
public Future<Void>
find(Channel channel)

Implements io.netty5.channel.group.ChannelGroupFuture.find.

Returns the Future of the individual I/O operation which is associated with the specified Channel.
public ChannelGroup
group()

Implements io.netty5.channel.group.ChannelGroupFuture.group.

Returns the ChannelGroup which is associated with this future.
public synchronized boolean
isPartialFailure()

Implements io.netty5.channel.group.ChannelGroupFuture.isPartialFailure.

Returns true if and only if the I/O operations associated with this future have failed partially with some success.
public synchronized boolean
isPartialSuccess()

Implements io.netty5.channel.group.ChannelGroupFuture.isPartialSuccess.

Returns true if and only if the I/O operations associated with this future were partially successful with some failure.
public Iterator<Future<Void>>
iterator()

Implements io.netty5.channel.group.ChannelGroupFuture.iterator.

Returns the Iterator that enumerates all Futures which are associated with this future.
public DefaultChannelGroupFuture
setFailure(Throwable cause)

Overrides io.netty5.util.concurrent.DefaultPromise.setFailure.

Implements io.netty5.util.concurrent.Promise.setFailure.

Marks this promise as a failure and notifies all listeners attached to the future.
private void
public DefaultChannelGroupFuture
setSuccess(Void result)

Overrides io.netty5.util.concurrent.DefaultPromise.setSuccess.

Implements io.netty5.util.concurrent.Promise.setSuccess.

Marks this promise as a success and notifies all listeners attached to the future.
private void
public boolean
tryFailure(Throwable cause)

Overrides io.netty5.util.concurrent.DefaultPromise.tryFailure.

Implements io.netty5.util.concurrent.Promise.tryFailure.

Marks this promise as a failure and notifies all listeners.
public boolean
trySuccess(Void result)

Overrides io.netty5.util.concurrent.DefaultPromise.trySuccess.

Implements io.netty5.util.concurrent.Promise.trySuccess.

Marks this future as a success and notifies all listeners.
Inherited from io.netty5.util.concurrent.DefaultPromise:
acceptEitheracceptEitherAsyncacceptEitherAsyncaddListenerapplyToEitherapplyToEitherAsyncapplyToEitherAsyncasFutureasStageawaitcancelcancelcheckDeadLockexceptionallyexecutorfuturegetgetgetNowhandlehandleAsynchandleAsyncisCancellableisCancelledisDoneisFailedisSuccessrunAfterBothrunAfterBothAsyncrunAfterBothAsyncrunAfterEitherrunAfterEitherAsyncrunAfterEitherAsyncsetUncancellablesyncthenAcceptthenAcceptAsyncthenAcceptAsyncthenAcceptBoththenAcceptBothAsyncthenAcceptBothAsyncthenApplythenApplyAsyncthenApplyAsyncthenCombinethenCombineAsyncthenCombineAsyncthenComposethenComposeAsyncthenComposeAsyncthenRunthenRunAsyncthenRunAsynctoStringtoStringBuilderwhenCompletewhenCompleteAsyncwhenCompleteAsync

Field Detail

childListenerback to summary
private final FutureListener<Void> childListener
failureCountback to summary
private int failureCount
futuresback to summary
private final Map<Channel, Future<Void>> futures
groupback to summary
private final ChannelGroup group
successCountback to summary
private int successCount

Constructor Detail

DefaultChannelGroupFutureback to summary
pack-priv DefaultChannelGroupFuture(ChannelGroup group, Map<Channel, Future<Void>> futures, EventExecutor executor)

Method Detail

addListenerback to summary
public DefaultChannelGroupFuture addListener(FutureListener<? super Void> listener)

Overrides io.netty5.util.concurrent.DefaultPromise.addListener.

Implements io.netty5.channel.group.ChannelGroupFuture.addListener, io.netty5.util.concurrent.Future.addListener.

Doc from io.netty5.util.concurrent.Future.addListener.

Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.

Parameters
listener:FutureListener<? super Void>

The listener to be called when this future completes. The listener will be passed this future as an argument.

Returns:DefaultChannelGroupFuture

this future object.

Annotations
@Override
awaitback to summary
public DefaultChannelGroupFuture await() throws InterruptedException

Overrides io.netty5.util.concurrent.DefaultPromise.await.

Implements io.netty5.util.concurrent.FutureCompletionStage.await.

Doc from io.netty5.util.concurrent.FutureCompletionStage.await.

Waits for this future to be completed.

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted
causeback to summary
public ChannelGroupException cause()

Overrides io.netty5.util.concurrent.DefaultPromise.cause.

Overrides default io.netty5.util.concurrent.FutureCompletionStage.cause.

Implements io.netty5.channel.group.ChannelGroupFuture.cause, io.netty5.util.concurrent.AsynchronousResult.cause.

Doc from io.netty5.util.concurrent.AsynchronousResult.cause.

Returns the cause of the failed operation if the operation has failed.

Returns:ChannelGroupException

The cause of the failure, if any. Otherwise null if succeeded.

Annotations
@Override
checkDeadLockback to summary
protected void checkDeadLock()

Overrides io.netty5.util.concurrent.DefaultPromise.checkDeadLock.

Annotations
@Override
findback to summary
public Future<Void> find(Channel channel)

Implements io.netty5.channel.group.ChannelGroupFuture.find.

Doc from io.netty5.channel.group.ChannelGroupFuture.find.

Returns the Future of the individual I/O operation which is associated with the specified Channel.

Returns:Future<Void>

the matching Future if found. null otherwise.

Annotations
@Override
groupback to summary
public ChannelGroup group()

Implements io.netty5.channel.group.ChannelGroupFuture.group.

Doc from io.netty5.channel.group.ChannelGroupFuture.group.

Returns the ChannelGroup which is associated with this future.

Annotations
@Override
isPartialFailureback to summary
public synchronized boolean isPartialFailure()

Implements io.netty5.channel.group.ChannelGroupFuture.isPartialFailure.

Doc from io.netty5.channel.group.ChannelGroupFuture.isPartialFailure.

Returns true if and only if the I/O operations associated with this future have failed partially with some success.

Annotations
@Override
isPartialSuccessback to summary
public synchronized boolean isPartialSuccess()

Implements io.netty5.channel.group.ChannelGroupFuture.isPartialSuccess.

Doc from io.netty5.channel.group.ChannelGroupFuture.isPartialSuccess.

Returns true if and only if the I/O operations associated with this future were partially successful with some failure.

Annotations
@Override
iteratorback to summary
public Iterator<Future<Void>> iterator()

Implements io.netty5.channel.group.ChannelGroupFuture.iterator.

Doc from io.netty5.channel.group.ChannelGroupFuture.iterator.

Returns the Iterator that enumerates all Futures which are associated with this future. Please note that the returned Iterator is is unmodifiable, which means a Future cannot be removed from this future.

Returns:Iterator<Future<Void>>

Doc from java.lang.Iterable.iterator.

an Iterator.

Annotations
@Override
setFailureback to summary
public DefaultChannelGroupFuture setFailure(Throwable cause)

Overrides io.netty5.util.concurrent.DefaultPromise.setFailure.

Implements io.netty5.util.concurrent.Promise.setFailure.

Doc from io.netty5.util.concurrent.Promise.setFailure.

Marks this promise as a failure and notifies all listeners attached to the future.

If it is success or failed already it will throw an IllegalStateException.

Annotations
@Override
setFailure0back to summary
private void setFailure0(ChannelGroupException cause)
setSuccessback to summary
public DefaultChannelGroupFuture setSuccess(Void result)

Overrides io.netty5.util.concurrent.DefaultPromise.setSuccess.

Implements io.netty5.util.concurrent.Promise.setSuccess.

Doc from io.netty5.util.concurrent.Promise.setSuccess.

Marks this promise as a success and notifies all listeners attached to the future.

If it is success or failed already it will throw an IllegalStateException.

Annotations
@Override
setSuccess0back to summary
private void setSuccess0()
tryFailureback to summary
public boolean tryFailure(Throwable cause)

Overrides io.netty5.util.concurrent.DefaultPromise.tryFailure.

Implements io.netty5.util.concurrent.Promise.tryFailure.

Doc from io.netty5.util.concurrent.Promise.tryFailure.

Marks this promise as a failure and notifies all listeners.

Returns:boolean

true if and only if successfully marked this promise as a failure. Otherwise false because this promise is already marked as either a success or a failure.

Annotations
@Override
trySuccessback to summary
public boolean trySuccess(Void result)

Overrides io.netty5.util.concurrent.DefaultPromise.trySuccess.

Implements io.netty5.util.concurrent.Promise.trySuccess.

Doc from io.netty5.util.concurrent.Promise.trySuccess.

Marks this future as a success and notifies all listeners.

Returns:boolean

true if and only if successfully marked this promise as a success. Otherwise false because this promise is already marked as either a success or a failure.

Annotations
@Override
io.netty5.channel.group back to summary

private final Class DefaultChannelGroupFuture.DefaultEntry<K, V>

extends Object
implements Map.Entry<K, V>
Class Inheritance
  • java.lang.Object
  • io.netty5.channel.group.DefaultChannelGroupFuture.DefaultEntry
All Implemented Interfaces
java.util.Map.Entry

Field Summary

Modifier and TypeField and Description
private final K
private final V

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultEntry(K key, V value)

Method Summary

Modifier and TypeMethod and Description
public K
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.
public V
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.
public V
setValue(V
new value to be stored in this entry
value
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final K key
valueback to summary
private final V value

Constructor Detail

DefaultEntryback to summary
pack-priv DefaultEntry(K key, V value)

Method Detail

getKeyback to summary
public K getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:K

the key corresponding to this entry

Annotations
@Override
getValueback to summary
public V getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:V

the value corresponding to this entry

Annotations
@Override
setValueback to summary
public V setValue(V value)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
value:V

new value to be stored in this entry

Returns:V

old value corresponding to the entry

Annotations
@Override