boolean processEvent(long address){
  short source=unsafe.getShort(address + OFFSETOF_SOURCE);
  long object=unsafe.getAddress(address + OFFSETOF_OBJECT);
  int events=unsafe.getInt(address + OFFSETOF_EVENTS);
  if (source != PORT_SOURCE_FILE) {
    if (source == PORT_SOURCE_USER) {
      boolean shutdown=processRequests();
      if (shutdown)       return true;
    }
    return false;
  }
  Node node=object2Node.get(object);
  if (node == null) {
    return false;
  }
  boolean reregister=true;
  boolean isDirectory=(node instanceof SolarisWatchKey);
  if (isDirectory) {
    processDirectoryEvents((SolarisWatchKey)node,events);
  }
 else {
    boolean ignore=processEntryEvents((EntryNode)node,events);
    if (ignore)     reregister=false;
  }
  if (reregister) {
    try {
      events=FILE_MODIFIED | FILE_ATTRIB;
      if (!isDirectory)       events|=FILE_NOFOLLOW;
      portAssociate(port,PORT_SOURCE_FILE,object,events);
    }
 catch (    UnixException x) {
      reregister=false;
    }
  }
  if (!reregister) {
    object2Node.remove(object);
    releaseObject(object,false);
    if (isDirectory) {
      SolarisWatchKey key=(SolarisWatchKey)node;
      fileKey2WatchKey.remove(key.getFileKey());
      key.invalidate();
      key.signal();
    }
 else {
      EntryNode entry=(EntryNode)node;
      SolarisWatchKey key=(SolarisWatchKey)entry.parent();
      key.removeChild(entry.name());
    }
  }
  return false;
}

boolean processEvent ( long address ) { short source = unsafe . getShort ( address + OFFSETOF_SOURCE ) ; long object = unsafe . getAddress ( address + OFFSETOF_OBJECT ) ; int events = unsafe . getInt ( address + OFFSETOF_EVENTS ) ; if ( source != PORT_SOURCE_FILE ) { if ( source == PORT_SOURCE_USER ) { boolean shutdown = processRequests ( ) ; if ( shutdown ) return true ; } return false ; } Node node = object2Node . get ( object ) ; if ( node == null ) { return false ; } boolean reregister = true ; boolean isDirectory = ( node instanceof SolarisWatchKey ) ; if ( isDirectory ) { processDirectoryEvents ( ( SolarisWatchKey ) node , events ) ; } else { boolean ignore = processEntryEvents ( ( EntryNode ) node , events ) ; if ( ignore ) reregister = false ; } if ( reregister ) { try { events = FILE_MODIFIED | FILE_ATTRIB ; if ( ! isDirectory ) events |= FILE_NOFOLLOW ; portAssociate ( port , PORT_SOURCE_FILE , object , events ) ; } catch ( UnixException x ) { reregister = false ; } } if ( ! reregister ) { object2Node . remove ( object ) ; releaseObject ( object , false ) ; if ( isDirectory ) { SolarisWatchKey key = ( SolarisWatchKey ) node ; fileKey2WatchKey . remove ( key . getFileKey ( ) ) ; key . invalidate ( ) ; key . signal ( ) ; } else { EntryNode entry = ( EntryNode ) node ; SolarisWatchKey key = ( SolarisWatchKey ) entry . parent ( ) ; key . removeChild ( entry . name ( ) ) ; } } return false ; }
process a single port_event returns true if poller thread is requested to shutdown .
