java.nio.channels.spi

Class AbstractInterruptibleChannel

public abstract class AbstractInterruptibleChannel extends Object implements Channel, InterruptibleChannel

Since: 1.4

Constructor Summary
protected AbstractInterruptibleChannel()
Initializes the channel.
Method Summary
protected voidbegin()
Marks the beginning of an I/O operation that might block indefinitely.
voidclose()
Closes the channel.
protected voidend(boolean completed)
Marks the end of an I/O operation that might block indefinitely.
protected abstract voidimplCloseChannel()
Closes the channel.
booleanisOpen()
Tells whether or not this channel is open.

Constructor Detail

AbstractInterruptibleChannel

protected AbstractInterruptibleChannel()
Initializes the channel.

Method Detail

begin

protected final void begin()
Marks the beginning of an I/O operation that might block indefinitely.

close

public final void close()
Closes the channel.

Throws: IOException If an error occurs

end

protected final void end(boolean completed)
Marks the end of an I/O operation that might block indefinitely.

Parameters: completed true if the task completed successfully, false otherwise

Throws: AsynchronousCloseException If the channel was asynchronously closed. ClosedByInterruptException If the thread blocked in the I/O operation was interrupted.

implCloseChannel

protected abstract void implCloseChannel()
Closes the channel.

Throws: IOException If an error occurs

isOpen

public final boolean isOpen()
Tells whether or not this channel is open.

Returns: true if the channel is open, false otherwise