How to use channel groups from custom implementation?

Alan Bateman Alan.Bateman at oracle.com
Wed Jul 13 06:36:13 PDT 2011


Gili wrote:
> :
> So you're saying that if I wanted to publish an AsynchronousByteChannel
> implementation in the supported fashion, I'd have to publish a corresponding
> AsynchronousChannelGroup implementation and specify that my channel only
> accepts this specific channel group. Is that correct?
>   
Channel groups are only needed if you are sharing resources so if you 
don't need this then you don't need to associate the channel with a 
group. I recall your previous mails where you were working on a channel 
to a serial port. Is this still the case? I will guess that a typical 
application won't require a huge number of channels, in which supporting 
channel groups may be overkill anyway.

> I assume this means MyChannel.open(AsynchronousChannelGroup) with the wrong
> implementation may throw IllegalArgumentException?
>   
IllegalChannelGroupException (an IllegalArgumentException) is probably 
best.

-Alan


More information about the nio-discuss mailing list