AsynchronousByteCharChannel and Timeouts
Alan Bateman
Alan.Bateman at Sun.COM
Fri Jul 31 12:13:19 PDT 2009
Gili wrote:
> Alternatively, we could define these methods in AsynchronousByteChannel and
> mark them as optional. Subclasses would then document whether they support
> timeouts or not. This would be a similar design to Collections.
>
> I'm still trying to figure out how to design AsynchronousByteCharChannel for
> AsynchronousByteChannels with timeouts and without. If the timeout methods
> are optional then the design becomes quite simple. If not, I might have to
> create two different adapters: one for ByteChannels with timeouts, one for
> ones without it.
>
> Ideas anyone?
>
> Gili
>
Another suggestion is to create a class that decorates a given
AsynchronousByteChannel, extending it with methods for timed operations.
You should be able to combine any AsynchronousByteChannel with the timer
support in j.u.c and create a nice solution.
-Alan.
More information about the nio-discuss
mailing list