Class IoUtil
java.lang.Object
org.apache.mina.core.IoUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic booleanstatic booleanprivate static booleanstatic voidawaitUninterruptably(Iterable<? extends IoFuture> futures) Wait on all theIoFutures we get.static booleanawaitUninterruptibly(Iterable<? extends IoFuture> futures, long timeoutMillis) Wait on all theIoFutures we get.static booleanawaitUninterruptibly(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit) Wait on all theIoFutures we get.static List<WriteFuture> Writes the specifiedmessageto the specifiedsessions.static List<WriteFuture> broadcast(Object message, Collection<IoSession> sessions) Writes the specifiedmessageto the specifiedsessions.static List<WriteFuture> Writes the specifiedmessageto the specifiedsessions.private static voidbroadcast(Object message, Iterator<IoSession> sessions, Collection<WriteFuture> answer) static List<WriteFuture> Writes the specifiedmessageto the specifiedsessions.
-
Field Details
-
EMPTY_SESSIONS
-
-
Constructor Details
-
IoUtil
private IoUtil()
-
-
Method Details
-
broadcast
Writes the specifiedmessageto the specifiedsessions. If the specifiedmessageis anIoBuffer, the buffer is automatically duplicated usingIoBuffer.duplicate().- Parameters:
message- The message to broadcastsessions- The sessions that will receive the message- Returns:
- The list of WriteFuture created for each broadcasted message
-
broadcast
Writes the specifiedmessageto the specifiedsessions. If the specifiedmessageis anIoBuffer, the buffer is automatically duplicated usingIoBuffer.duplicate().- Parameters:
message- The message to broadcastsessions- The sessions that will receive the message- Returns:
- The list of WriteFuture created for each broadcasted message
-
broadcast
Writes the specifiedmessageto the specifiedsessions. If the specifiedmessageis anIoBuffer, the buffer is automatically duplicated usingIoBuffer.duplicate().- Parameters:
message- The message to writesessions- The sessions the message has to be written to- Returns:
- The list of
WriteFuturefor the written messages
-
broadcast
Writes the specifiedmessageto the specifiedsessions. If the specifiedmessageis anIoBuffer, the buffer is automatically duplicated usingIoBuffer.duplicate().- Parameters:
message- The message to writesessions- The sessions the message has to be written to- Returns:
- The list of
WriteFuturefor the written messages
-
broadcast
private static void broadcast(Object message, Iterator<IoSession> sessions, Collection<WriteFuture> answer) -
await
- Parameters:
futures- TheIoFutures we are waiting on- Throws:
InterruptedException- If one of theIoFutureis interrupted
-
awaitUninterruptably
-
await
public static boolean await(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit) throws InterruptedException - Parameters:
futures- TheIoFutures we are waiting ontimeout- The maximum time we wait for theIoFutures to completeunit- The Time unit to use for the timeout- Returns:
TRUEif all theIoFuturehave been completed,FALSEif at least oneIoFuturehas been interrupted- Throws:
InterruptedException- If one of theIoFutureis interrupted
-
await
public static boolean await(Iterable<? extends IoFuture> futures, long timeoutMillis) throws InterruptedException - Parameters:
futures- TheIoFutures we are waiting ontimeoutMillis- The maximum milliseconds we wait for theIoFutures to complete- Returns:
TRUEif all theIoFuturehave been completed,FALSEif at least oneIoFuturehas been interrupted- Throws:
InterruptedException- If one of theIoFutureis interrupted
-
awaitUninterruptibly
-
awaitUninterruptibly
-
await0
private static boolean await0(Iterable<? extends IoFuture> futures, long timeoutMillis, boolean interruptable) throws InterruptedException - Throws:
InterruptedException
-