Code example for SelectionKey

Methods: selector

0
		closeChannel(true); 
		closeSelector(selector(), true); 
		return new IllegalStateException(e);
	} 
 
	private Selector selector() {return key.selector();}
 
	private SelectionKey obtainSelectorKey(final Selector selector)
	{ 
		try 
		{ 
			return channel.register(selector, 0);
		} 
		catch (final ClosedChannelException e)
		{ 
			closeSelector(selector, true);
			closeChannel(true); 
			throw new CanNeverHappenException(e);
		} 
	}