Top Description Inners Fields Constructors Methods
org.apache.tomcat.websocket

public Class AsyncChannelWrapperNonSecure

extends Object
implements AsyncChannelWrapper
Class Inheritance
All Implemented Interfaces
org.apache.tomcat.websocket.AsyncChannelWrapper
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.nio.channels.AsynchronousSocketChannel, .CompletionHandler, java.util.concurrent.ExecutionException, .Future, .TimeUnit, .TimeoutException

Generally, just passes calls straight to the wrapped AsynchronousSocketChannel. In some cases exceptions may be swallowed to save them being swallowed by the calling code.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Future<Void>
private final AsynchronousSocketChannel

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public SocketAddress
public Future<Void>
public Future<Integer>
public <B, A extends B> void
public Future<Integer>
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.apache.tomcat.websocket.AsyncChannelWrapper.write.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NOOP_FUTUREback to summary
private static final Future<Void> NOOP_FUTURE
socketChannelback to summary
private final AsynchronousSocketChannel socketChannel

Constructor Detail

AsyncChannelWrapperNonSecureback to summary
public AsyncChannelWrapperNonSecure(AsynchronousSocketChannel socketChannel)

Method Detail

closeback to summary
public void close()

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.close.

Annotations
@Override
getLocalAddressback to summary
public SocketAddress getLocalAddress() throws IOException

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.getLocalAddress.

Annotations
@Override
handshakeback to summary
public Future<Void> handshake()

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.handshake.

Annotations
@Override
readback to summary
public Future<Integer> read(ByteBuffer dst)

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.read.

Annotations
@Override
readback to summary
public <B, A extends B> void read(ByteBuffer dst, A attachment, CompletionHandler<Integer, B> handler)

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.read.

Annotations
@Override
writeback to summary
public Future<Integer> write(ByteBuffer src)

Implements org.apache.tomcat.websocket.AsyncChannelWrapper.write.

Annotations
@Override
writeback 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.apache.tomcat.websocket.AsyncChannelWrapper.write.

Annotations
@Override
org.apache.tomcat.websocket back to summary

private final Class AsyncChannelWrapperNonSecure.NoOpFuture

extends Object
implements Future<Void>
Class Inheritance
  • java.lang.Object
  • org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.NoOpFuture
All Implemented Interfaces
java.util.concurrent.Future

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod 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 complete
mayInterruptIfRunning
)

Implements java.util.concurrent.Future.cancel.

Attempts to cancel execution of this task.

public Void
get()

Implements java.util.concurrent.Future.get.

Waits if necessary for the computation to complete, and then retrieves its result.

public Void
get(long
the maximum time to wait
timeout
,
TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.Future.get.

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.util.concurrent.Future.isCancelled.

Returns true if this task was cancelled before it completed normally.

public boolean
isDone()

Implements java.util.concurrent.Future.isDone.

Returns true if this task completed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NoOpFutureback to summary
private NoOpFuture()

Method Detail

cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Implements java.util.concurrent.Future.cancel.

Doc from java.util.concurrent.Future.cancel.

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 cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task (when known by the implementation) is interrupted in an attempt to stop the task.

The return value from this method does not necessarily indicate whether the task is now cancelled; use isCancelled.

Parameters
mayInterruptIfRunning: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 complete

Returns:boolean

false if the task could not be cancelled, typically because it has already completed; true otherwise. If two or more threads cause a task to be cancelled, then at least one of them returns true. Implementations may provide stronger guarantees.

Annotations
@Override
getback to summary
public Void get() throws InterruptedException, ExecutionException

Implements java.util.concurrent.Future.get.

Doc from java.util.concurrent.Future.get.

Waits if necessary for the computation to complete, and then retrieves its result.

Returns:Void

the computed result

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted while waiting
ExecutionException:
if the computation threw an exception
getback to summary
public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException

Implements java.util.concurrent.Future.get.

Doc from java.util.concurrent.Future.get.

Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.

Parameters
timeout:long

the maximum time to wait

unit:TimeUnit

the time unit of the timeout argument

Returns:Void

the computed result

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted while waiting
ExecutionException:
if the computation threw an exception
TimeoutException:
if the wait timed out
isCancelledback to summary
public boolean isCancelled()

Implements java.util.concurrent.Future.isCancelled.

Doc from java.util.concurrent.Future.isCancelled.

Returns true if this task was cancelled before it completed normally.

Returns:boolean

true if this task was cancelled before it completed

Annotations
@Override
isDoneback to summary
public boolean isDone()

Implements java.util.concurrent.Future.isDone.

Doc from java.util.concurrent.Future.isDone.

Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

Returns:boolean

true if this task completed

Annotations
@Override