public void run(){
  BufferedReader tdin=null;
  PrintWriter tdout=null;
  if (viewName == null) {
    Debug.error("NetMapReader not given a view name to request from the NETMAP server.");
    return;
  }
  while (!this.shutdown) {
    if (DEBUG)     Debug.output("NetMapReader attempting connection");
    try {
      tdin=new BufferedReader(new InputStreamReader(s.getInputStream()));
      tdout=new PrintWriter(s.getOutputStream(),true);
      if (DEBUG)       Debug.output("Loading view: " + viewName);
      tdout.println("jmap '" + viewName + "' 768");
      s.setSoTimeout(500);
    }
 catch (    InterruptedIOException eConnectInterrupted) {
      continue;
    }
catch (    IOException eConnect) {
      Debug.error("NetMapReader: " + eConnect.getMessage() + "; NetMapReader sleeping");
      try {
        Thread.sleep(40000);
      }
 catch (      Exception eSleep) {
      }
      continue;
    }
    if (netmapConn == null) {
      continue;
    }
    netmapConn.connectionUp();
    while (!this.shutdown) {
      try {
        String line=null;
        if ((line=tdin.readLine()) == null)         break;
        if (DEBUG_VERBOSE)         Debug.output("  read: " + line);
        Properties eventProps=procline(line);
        if (DEBUG_VERBOSE)         Debug.output("  processed...");
        if (!eventProps.isEmpty()) {
          netmapConn.distributeEvent(eventProps);
          if (DEBUG_VERBOSE)           Debug.output("  distributed...");
        }
 else {
          if (DEBUG_VERBOSE)           Debug.output("  ignored...");
        }
      }
 catch (      InterruptedIOException eReadInterrupted) {
        continue;
      }
catch (      Exception e) {
        Debug.error("NetMapReader exception: " + e.getMessage() + "; in NetMapReader run. ");
        continue;
      }
    }
    try {
      s.close();
      netmapConn.connectionDown();
    }
 catch (    Exception eShutdown) {
    }
  }
}

public void run ( ) { BufferedReader tdin = null ; PrintWriter tdout = null ; if ( viewName == null ) { Debug . error ( "NetMapReader not given a view name to request from the NETMAP server." ) ; return ; } while ( ! this . shutdown ) { if ( DEBUG ) Debug . output ( "NetMapReader attempting connection" ) ; try { tdin = new BufferedReader ( new InputStreamReader ( s . getInputStream ( ) ) ) ; tdout = new PrintWriter ( s . getOutputStream ( ) , true ) ; if ( DEBUG ) Debug . output ( "Loading view: " + viewName ) ; tdout . println ( "jmap '" + viewName + "' 768" ) ; s . setSoTimeout ( 500 ) ; } catch ( InterruptedIOException eConnectInterrupted ) { continue ; } catch ( IOException eConnect ) { Debug . error ( "NetMapReader: " + eConnect . getMessage ( ) + "; NetMapReader sleeping" ) ; try { Thread . sleep ( 40000 ) ; } catch ( Exception eSleep ) { } continue ; } if ( netmapConn == null ) { continue ; } netmapConn . connectionUp ( ) ; while ( ! this . shutdown ) { try { String line = null ; if ( ( line = tdin . readLine ( ) ) == null ) break ; if ( DEBUG_VERBOSE ) Debug . output ( "  read: " + line ) ; Properties eventProps = procline ( line ) ; if ( DEBUG_VERBOSE ) Debug . output ( "  processed..." ) ; if ( ! eventProps . isEmpty ( ) ) { netmapConn . distributeEvent ( eventProps ) ; if ( DEBUG_VERBOSE ) Debug . output ( "  distributed..." ) ; } else { if ( DEBUG_VERBOSE ) Debug . output ( "  ignored..." ) ; } } catch ( InterruptedIOException eReadInterrupted ) { continue ; } catch ( Exception e ) { Debug . error ( "NetMapReader exception: " + e . getMessage ( ) + "; in NetMapReader run. " ) ; continue ; } } try { s . close ( ) ; netmapConn . connectionDown ( ) ; } catch ( Exception eShutdown ) { } } }
called when netmapreader . start ( ) is called . this makes the netmapreader call the netmap server to get information about the view that is set . this assumes that the view has been set . the netmapconnector will be called back with properties objects describing events received .
