Android
java.nio.channels.spi
public abstract class

java.nio.channels.spi.AbstractInterruptibleChannel

java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel Channel InterruptibleChannel

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

            AbstractInterruptibleChannel()
Default constructor.

Public Methods

    final      void  close()
Closes the channel.
  synchronized  final      boolean  isOpen()
Returns whether the channel is open.

Protected Methods

    final      void  begin()
Start an IO operation that is potentially blocking.
    final      void  end(boolean success)
End an IO operation that was previously started with begin().
abstract          void  implCloseChannel()
Implements the close channel behavior.
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable
Methods inherited from interface java.nio.channels.Channel
Methods inherited from interface java.nio.channels.InterruptibleChannel

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.

Throws

IOException

See Also

public final synchronized boolean isOpen()

Returns whether the channel is open.

Returns

  • true if the channel is open, and false if it is closed.

See Also

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.

Throws

AsynchronousCloseException the channel was closed while the IO operation was in progress.
ClosedByInterruptException the thread conducting the IO operation was interrupted.

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.

Throws

IOException if a problem occurs closing the channel.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48