com.sun.jini.jeri.internal.runtime
Class SelectionManager.Key

java.lang.Object
  extended by com.sun.jini.jeri.internal.runtime.SelectionManager.Key
Enclosing class:
SelectionManager

public final class SelectionManager.Key
extends Object

A Key represents a given SelectableChannel's registration with this SelectionManager. Externally, this object is used to re-register interest in I/O readiness events that have been previously detected and dispatched.


Field Summary
(package private)  SelectableChannel channel
          the channel that this Key represents a registration for
(package private)  SelectionManager.SelectionHandler handler
          the supplied callback object for dispatching I/O events
(package private)  int interestMask
          the current interest mask established with the SelectionKey
(package private)  boolean onReadyQueue
           
(package private)  boolean onRenewQueue
           
(package private)  int readyMask
           
(package private)  SelectionManager.Key readyQueueNext
           
(package private)  int renewMask
           
(package private)  SelectionManager.Key renewQueueNext
           
(package private)  SelectionKey selectionKey
          the SelectionKey representing this Key's registration with the internal Selector, or null if it hasn't yet been registered
 
Constructor Summary
SelectionManager.Key(SelectableChannel channel, SelectionManager.SelectionHandler handler)
           
 
Method Summary
 void renewInterestMask(int mask)
          Renews interest in receiving notifications when the I/O operations identified by the specified mask are ready for the associated SelectableChannel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

final SelectableChannel channel
the channel that this Key represents a registration for


handler

final SelectionManager.SelectionHandler handler
the supplied callback object for dispatching I/O events


selectionKey

SelectionKey selectionKey
the SelectionKey representing this Key's registration with the internal Selector, or null if it hasn't yet been registered


interestMask

int interestMask
the current interest mask established with the SelectionKey


onRenewQueue

boolean onRenewQueue

renewQueueNext

SelectionManager.Key renewQueueNext

renewMask

int renewMask

onReadyQueue

boolean onReadyQueue

readyQueueNext

SelectionManager.Key readyQueueNext

readyMask

int readyMask
Constructor Detail

SelectionManager.Key

SelectionManager.Key(SelectableChannel channel,
                     SelectionManager.SelectionHandler handler)
Method Detail

renewInterestMask

public void renewInterestMask(int mask)
                       throws ClosedChannelException
Renews interest in receiving notifications when the I/O operations identified by the specified mask are ready for the associated SelectableChannel. The specified mask identifies I/O operations with the same bit values as would a java.nio.SelectionKey for the same SelectableChannel. Some time after one of the operations specified in the mask is detected to be ready, the previously-registered SelectionHandler callback object will be invoked to handle the readiness event. An event for each operation specified will only be dispatched to the callback handler once for the invocation of this method; to re-register interest in subsequent readiness of the same operation for the given channel, this method must be invoked again.

Throws:
ClosedChannelException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.