Code example for SelectableChannel

Methods: configureBlockingregister

                                   SelectableChannel channel,
                                   int ops,
                                   Object attach) throws Exception {
        if (channel == null)return; // could happen
        // set the new channel non-blocking 
        // register it with the selector 
        channel.register(selector, ops, attach);
     * Start thread and listen 
    public void run() { 
        try { 
        } catch (Exception x) {
            log.error("Unable to run replication listener.", x);
Connect your IDE to all the code out there  Get Codota for Java