AsynchronousSocketChannel with SSL/TLS. This needs a lot more testing before it can be considered
robust.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class | |
| private static class | |
| private class | |
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private static final ByteBuffer | |
| private final ExecutorService | |
| private final Log | |
| private AtomicBoolean | |
| private static final StringManager | |
| private final AsynchronousSocketChannel | |
| private final ByteBuffer | |
| private final ByteBuffer | |
| private final SSLEngine | |
| private AtomicBoolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public SocketAddress | |
| public Future | |
| public Future | |
| public <B, A extends B> void | read(ByteBuffer dst, A attachment, CompletionHandler<Integer, B> handler)
Implements org.
|
| public Future | |
| public <B, A extends B> void | write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, B> handler)
Implements org.
|
| DUMMY | back to summary |
|---|---|
| private static final ByteBuffer DUMMY | |
| executor | back to summary |
|---|---|
| private final ExecutorService executor | |
| log | back to summary |
|---|---|
| private final Log log | |
| reading | back to summary |
|---|---|
| private AtomicBoolean reading | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| socketChannel | back to summary |
|---|---|
| private final AsynchronousSocketChannel socketChannel | |
| socketReadBuffer | back to summary |
|---|---|
| private final ByteBuffer socketReadBuffer | |
| socketWriteBuffer | back to summary |
|---|---|
| private final ByteBuffer socketWriteBuffer | |
| sslEngine | back to summary |
|---|---|
| private final SSLEngine sslEngine | |
| writing | back to summary |
|---|---|
| private AtomicBoolean writing | |
| AsyncChannelWrapperSecure | back to summary |
|---|---|
| public AsyncChannelWrapperSecure(AsynchronousSocketChannel socketChannel, SSLEngine sslEngine) | |
| close | back to summary |
|---|---|
| public void close() Implements org.
| |
| getLocalAddress | back to summary |
|---|---|
| public SocketAddress getLocalAddress() throws IOException Implements org.
| |
| handshake | back to summary |
|---|---|
| public Future Implements org.
| |
| read | back to summary |
|---|---|
| public Future Implements org.
| |
| read | back to summary |
|---|---|
| public <B, A extends B> void read(ByteBuffer dst, A attachment, CompletionHandler<Integer, B> handler) Implements org.
| |
| write | back to summary |
|---|---|
| public Future Implements org.
| |
| write | back to summary |
|---|---|
| public <B, A extends B> void write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, B> handler) Implements org.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | cancel(boolean
true if the thread
executing this task should be interrupted (if the thread is
known to the implementation); otherwise, in-progress tasks are
allowed to completeImplements java. Attempts to cancel execution of this task. |
| public Integer | get()
Implements java. Waits if necessary for the computation to complete, and then retrieves its result. |
| public Integer | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
| public boolean | isCancelled()
Implements java. Returns |
| public boolean |
| wrapped | back to summary |
|---|---|
| private final Future<Long> wrapped | |
| LongToIntegerFuture | back to summary |
|---|---|
| pack-priv LongToIntegerFuture(Future<Long> wrapped) | |
| cancel | back to summary |
|---|---|
| public boolean cancel(boolean mayInterruptIfRunning) Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use
| |
| get | back to summary |
|---|---|
| public Integer get() throws InterruptedException, ExecutionException Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public Integer get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Implements java. Doc from java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
| |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Implements java. Doc from java. Returns
| |
| isDone | back to summary |
|---|---|
| public boolean isDone() Implements java. Doc from java. Returns
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer | |
| private final AsyncChannelWrapperSecure. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| dest | back to summary |
|---|---|
| private final ByteBuffer dest | |
| future | back to summary |
|---|---|
| private final AsyncChannelWrapperSecure. | |
| ReadTask | back to summary |
|---|---|
| pack-priv ReadTask(ByteBuffer dest, AsyncChannelWrapperSecure. | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private AtomicInteger |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Thread | newThread(Runnable
a runnable to be executed by new thread instance r)Implements java. Constructs a new unstarted |
| count | back to summary |
|---|---|
| private AtomicInteger count | |
| SecureIOThreadFactory | back to summary |
|---|---|
| private SecureIOThreadFactory() | |
| newThread | back to summary |
|---|---|
| public Thread newThread(Runnable r) Implements java. Doc from java. Constructs a new unstarted | |
| Modifier and Type | Field and Description |
|---|---|
| private SSLEngineResult. | |
| private final AsyncChannelWrapperSecure. | |
| private SSLEngineResult. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | run()
Overrides java. Implements java. This method is run by the thread when it executes. |
| handshakeStatus | back to summary |
|---|---|
| private SSLEngineResult. | |
| hFuture | back to summary |
|---|---|
| private final AsyncChannelWrapperSecure. | |
| resultStatus | back to summary |
|---|---|
| private SSLEngineResult. | |
| WebSocketSslHandshakeThread | back to summary |
|---|---|
| pack-priv WebSocketSslHandshakeThread(AsyncChannelWrapperSecure. | |
| checkResult | back to summary |
|---|---|
| private void checkResult(SSLEngineResult result, boolean wrap) throws SSLException | |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. Doc from java. This method is run by the thread when it executes. Subclasses of This method is not intended to be invoked directly. If this thread is a
platform thread created with a
| |
| Modifier and Type | Field and Description |
|---|---|
| private final A | |
| private CountDownLatch | |
| private final CompletionHandler | |
| private volatile T | |
| private volatile Throwable |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | cancel(boolean
true if the thread
executing this task should be interrupted (if the thread is
known to the implementation); otherwise, in-progress tasks are
allowed to completeImplements java. Attempts to cancel execution of this task. |
| public void | |
| public void | |
| public T | get()
Implements java. Waits if necessary for the computation to complete, and then retrieves its result. |
| public T | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
| public final boolean | isCancelled()
Implements java. Returns |
| public final boolean |
| attachment | back to summary |
|---|---|
| private final A attachment | |
| completionLatch | back to summary |
|---|---|
| private CountDownLatch completionLatch | |
| handler | back to summary |
|---|---|
| private final CompletionHandler<T, A> handler | |
| result | back to summary |
|---|---|
| private volatile T result | |
| throwable | back to summary |
|---|---|
| private volatile Throwable throwable | |
| WrapperFuture | back to summary |
|---|---|
| pack-priv WrapperFuture() | |
| WrapperFuture | back to summary |
|---|---|
| pack-priv WrapperFuture(CompletionHandler<T, A> handler, A attachment) | |
| cancel | back to summary |
|---|---|
| public final boolean cancel(boolean mayInterruptIfRunning) Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use
| |
| complete | back to summary |
|---|---|
| public void complete(T result) | |
| fail | back to summary |
|---|---|
| public void fail(Throwable t) | |
| get | back to summary |
|---|---|
| public T get() throws InterruptedException, ExecutionException Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Implements java. Doc from java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
| |
| isCancelled | back to summary |
|---|---|
| public final boolean isCancelled() Implements java. Doc from java. Returns
| |
| isDone | back to summary |
|---|---|
| public final boolean isDone() Implements java. Doc from java. Returns
| |
| Modifier and Type | Field and Description |
|---|---|
| private final AsyncChannelWrapperSecure. | |
| private final int | |
| private final int | |
| private final ByteBuffer[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | WriteTask(ByteBuffer[] srcs, int offset, int length, AsyncChannelWrapperSecure.
|
| Modifier and Type | Method and Description |
|---|---|
| public void |
| future | back to summary |
|---|---|
| private final AsyncChannelWrapperSecure. | |
| length | back to summary |
|---|---|
| private final int length | |
| offset | back to summary |
|---|---|
| private final int offset | |
| srcs | back to summary |
|---|---|
| private final ByteBuffer[] srcs | |
| WriteTask | back to summary |
|---|---|
| pack-priv WriteTask(ByteBuffer[] srcs, int offset, int length, AsyncChannelWrapperSecure. | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |