How to use channel groups from custom implementation?

Gili cowwoc at bbs.darktech.org
Wed Jul 13 05:31:49 PDT 2011


Alan Bateman wrote:
> 
> Gili wrote:
>> Hi,
>>
>> It's not clear how to make use of AsynchronousChannelGroup. The user
>> invokes
>> open(AsynchronousChannelGroup) on my custom AsynchronousByteChannel. What
>> next? How am I supposed to gain access to the underlying Executor used to
>> invoke the CompletionHandlers? How am I supposed to gain access to the
>> default channel group if he invokes open()?
>>   
> Channels in the same group share resources such as I/O event or 
> completion ports. All the details on demultiplexing are highly 
> provider/implementation specific and there isn't any supported way to 
> attach a new channel type to an existing provider implementation. It's a 
> similar to what we have with Selector where someone can't develop a 
> SelectableChannel implementation and have it work with the default 
> provider. Instead the replacement unit is the complete ball of wax that 
> is the SelectorProvider or AsynchronousChannelProvider and the 
> associated channel types.
> 

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?

I assume this means MyChannel.open(AsynchronousChannelGroup) with the wrong
implementation may throw IllegalArgumentException?

Thanks,
Gili

--
View this message in context: http://nio-discuss.970641.n3.nabble.com/How-to-use-channel-groups-from-custom-implementation-tp3163519p3165765.html
Sent from the nio-discuss mailing list archive at Nabble.com.


More information about the nio-discuss mailing list