protected boolean add ( Object socketOrChannel , final ItemHolder holder ) { if ( socketOrChannel == null ) { Socket socket = holder . socket ( ) ; SelectableChannel ch = holder . item ( ) . getRawSocket ( ) ; if ( ch == null ) { // not a channel assert ( socket != null ) ; socketOrChannel = socket ; } else if ( socket == null ) { // not a socket socketOrChannel = ch ; } } assert ( socketOrChannel != null ) ; CompositePollItem aggregate = items . get ( socketOrChannel ) ; if ( aggregate == null ) { aggregate = new CompositePollItem ( socketOrChannel ) ; items . put ( socketOrChannel , aggregate ) ; } final boolean rc = aggregate . holders . add ( holder ) ; if ( rc ) { all . add ( aggregate ) ; } return rc ; }
add an item to this poller