java.nio.channels.spi
public
abstract
class
java.nio.channels.spi.AbstractInterruptibleChannel
This class roots the implementation of interruptible channels.
The basic usage pattern for an interruptible channel is to invoke
begin()
before any IO operations, then
end(boolean)
after completing the operation. The argument to
the end method shows whether there has been any change to the java
environment that is visible to the API user.
Known Direct Subclasses
Known Indirect Subclasses
Summary
Protected Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Protected Constructors
protected
AbstractInterruptibleChannel()
Default constructor.
Public Methods
public
final
void
close()
Closes the channel.
If the channel is already closed then this method has no effect,
otherwise it closes the receiver via the implCloseChannel method.
public
final
synchronized
boolean
isOpen()
Returns whether the channel is open.
Returns
- true if the channel is open, and false if it is closed.
Protected Methods
protected
final
void
begin()
Start an IO operation that is potentially blocking.
Once the operation is completed the application should invoke a
corresponding end(boolean)
.
protected
final
void
end(boolean success)
End an IO operation that was previously started with
begin()
.
Parameters
success
| pass true if the operation succeeded and had a side effect on
the Java system, or false if not. |
protected
abstract
void
implCloseChannel()
Implements the close channel behavior.
Closes the channel with a guarantee that the channel is not currently
closed via close()
and that the method is thread-safe.
any outstanding threads blocked on IO operations on this channel must be
released with either a normal return code, or an
AsynchronousCloseException
.