hg: nio/nio/jdk: First installation of potential updates for M4

libman at terabit.com.au libman at terabit.com.au
Wed May 13 13:36:35 PDT 2009


Alan,
couple questions about latest changes in API:
1) what distribution should I use it ?
currently, I am working with b99

2) CompletionHandler
   does not support cancelled() callback.

Can I assume for my the filter futures that the following
behavior would be enough :

Future.cancel(boolean mayInterruptIfRunning)
{
   if (mayInterruptIfRunning) {
      associatedChannel.close();
   }
   else {
     // ignore cancel
   }
}

This will simplify a lot as no longer need to provide in filters
methods like onCancelFuture().


3) AsynchronousByteChannel  signature of methods have been changed:
    <A> void read(ByteBuffer dst,
                  A attachment,
                  CompletionHandler<Integer,? super A> handler);

    Future<Integer> read(ByteBuffer dst);

It is good - no longer needed to create future (even on demand) for the
first form. And for the first form no way to cancel operation. So
I assume that cancel() makes sense only with parameter mayInterrupt = true.
In other words we can always interpret Future.cancel() as indirect form of
AsynchronousChannel.close()

Alex





More information about the nio-dev mailing list