FileDocCategorySizeDatePackage
LookupThread.javaAPI DocExample1139Sat Sep 09 19:53:40 BST 2000None

LookupThread

public class LookupThread extends Thread

Fields Summary
private List
entries
PooledWeblog
log
Constructors Summary
public LookupThread(List entries, PooledWeblog log)

    this.entries = entries;
    this.log = log;
  
Methods Summary
public voidrun()

  
    String entry;

    while (true) {
    
      synchronized (entries) {
        while (entries.size() == 0) {
          if (log.isFinished()) return;
          try {
            entries.wait();
          }
          catch (InterruptedException e) {
          }
        }       
        entry = (String) entries.remove(entries.size()-1);
      }
      
      int index = entry.indexOf(' ", 0);
      String remoteHost = entry.substring(0, index);
      String theRest = entry.substring(index, entry.length());

      try {
        remoteHost = InetAddress.getByName(remoteHost).getHostName();
      }
      catch (Exception e) {
        // remoteHost remains in dotted quad format
      }

      try {
        log.log(remoteHost + theRest);
      }
      catch (IOException e) {
      } 
      this.yield();
      
    }