|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.nio.Util
final class Util
Utility methods for the asynchronous IO implementation.
| Nested Class Summary | |
|---|---|
(package private) static class |
Util.DoneFuture<V>
Base class for an already-finished Future. |
| Method Summary | ||
|---|---|---|
(package private) static
|
failedFuture(Throwable exception)
Returns a new, completed Util.DoneFuture that always throws the
given exception when its get methods are called. |
|
(package private) static
|
finishedFuture(V result)
Returns a new, completed Util.DoneFuture with the given result. |
|
(package private) static String |
formatOps(int ops)
Returns a concise string representation of the active SelectionKey operations set in the parameter ops. |
|
(package private) static
|
initCause(T exception,
Throwable cause)
Returns the given exception with its cause initialized. |
|
(package private) static String |
opName(int op)
Returns the human-readable name of the given SelectionKey
operation. |
|
(package private) static IllegalStateException |
unexpected(Throwable exception)
Returns an IllegalStateException indicating that the
given exception was not expected, and setting the cause to
that exception. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
static <T extends Throwable> T initCause(T exception,
Throwable cause)
T - the type of the parent exceptionexception - the exception to initializecause - the cause
IllegalArgumentException - if an attempt is made to set
an exception as its own cause
IllegalStateException - if the exception has already had
its cause initializedThrowable.initCause(Throwable)static IllegalStateException unexpected(Throwable exception)
IllegalStateException indicating that the
given exception was not expected, and setting the cause to
that exception.
exception - the unexpected exception
static <V> Future<V> finishedFuture(V result)
Util.DoneFuture with the given result.
V - the type of the resultresult - the result for the returned Future
Future with the given resultstatic <V> Future<V> failedFuture(Throwable exception)
Util.DoneFuture that always throws the
given exception when its get methods are called.
V - the type of the resultexception - the exception for the returned Future
to throw
Future that throws the exceptionstatic String formatOps(int ops)
SelectionKey operations set in the parameter ops.
For example, if ops is OP_READ | OP_WRITE, this
method returns the string "RW".
ops - the SelectionKey operations to format
SelectionKeystatic String opName(int op)
SelectionKey
operation.
op - a SelectionKey operation
IllegalArgumentException - if the op is not one of
the operation constants defined by SelectionKeySelectionKey
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||