public final class IoUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
await(Iterable<? extends IoFuture> futures)
|
static boolean |
await(Iterable<? extends IoFuture> futures,
long timeoutMillis)
|
static boolean |
await(Iterable<? extends IoFuture> futures,
long timeout,
TimeUnit unit)
|
static void |
awaitUninterruptably(Iterable<? extends IoFuture> futures)
Wait on all the
IoFuture s we get. |
static boolean |
awaitUninterruptibly(Iterable<? extends IoFuture> futures,
long timeoutMillis)
Wait on all the
IoFuture s we get. |
static boolean |
awaitUninterruptibly(Iterable<? extends IoFuture> futures,
long timeout,
TimeUnit unit)
Wait on all the
IoFuture s we get. |
static List<WriteFuture> |
broadcast(Object message,
Collection<IoSession> sessions)
Writes the specified
message to the specified sessions . |
static List<WriteFuture> |
broadcast(Object message,
IoSession... sessions)
Writes the specified
message to the specified sessions . |
static List<WriteFuture> |
broadcast(Object message,
Iterable<IoSession> sessions)
Writes the specified
message to the specified sessions . |
static List<WriteFuture> |
broadcast(Object message,
Iterator<IoSession> sessions)
Writes the specified
message to the specified sessions . |
public static List<WriteFuture> broadcast(Object message, Collection<IoSession> sessions)
message
to the specified sessions
.
If the specified message
is an IoBuffer
, the buffer is
automatically duplicated using IoBuffer.duplicate()
.message
- The message to broadcastsessions
- The sessions that will receive the messagepublic static List<WriteFuture> broadcast(Object message, Iterable<IoSession> sessions)
message
to the specified sessions
.
If the specified message
is an IoBuffer
, the buffer is
automatically duplicated using IoBuffer.duplicate()
.message
- The message to broadcastsessions
- The sessions that will receive the messagepublic static List<WriteFuture> broadcast(Object message, Iterator<IoSession> sessions)
message
to the specified sessions
.
If the specified message
is an IoBuffer
, the buffer is
automatically duplicated using IoBuffer.duplicate()
.message
- The message to writesessions
- The sessions the message has to be written toWriteFuture
for the written messagespublic static List<WriteFuture> broadcast(Object message, IoSession... sessions)
message
to the specified sessions
.
If the specified message
is an IoBuffer
, the buffer is
automatically duplicated using IoBuffer.duplicate()
.message
- The message to writesessions
- The sessions the message has to be written toWriteFuture
for the written messagespublic static void await(Iterable<? extends IoFuture> futures) throws InterruptedException
futures
- The IoFuture
s we are waiting onInterruptedException
- If one of the IoFuture
is interruptedpublic static void awaitUninterruptably(Iterable<? extends IoFuture> futures)
IoFuture
s we get. This can't get interrupted.futures
- The IoFuture
s we are waiting onpublic static boolean await(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit) throws InterruptedException
futures
- The IoFuture
s we are waiting ontimeout
- The maximum time we wait for the IoFuture
s to completeunit
- The Time unit to use for the timeoutIoFuture
have been completed, FALSE if
at least one IoFuture
haas been interruptedInterruptedException
- If one of the IoFuture
is interruptedpublic static boolean await(Iterable<? extends IoFuture> futures, long timeoutMillis) throws InterruptedException
futures
- The IoFuture
s we are waiting ontimeoutMillis
- The maximum milliseconds we wait for the IoFuture
s to completeIoFuture
have been completed, FALSE if
at least one IoFuture
has been interruptedInterruptedException
- If one of the IoFuture
is interruptedpublic static boolean awaitUninterruptibly(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit)
IoFuture
s we get.Copyright © 2004–2021 Apache MINA Project. All rights reserved.