亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? spider.java

?? 網絡機器人
?? JAVA
字號:
/** * The Spider class is the main organizational class for * spidering.  It delegates work to the SpiderWorker class. * * Copyright 2001 by Jeff Heaton * * @author Jeff Heaton * @version 1.0 */package com.heaton.bot;import java.util.*;import java.io.*;import com.heaton.bot.*;public class Spider extends Thread implements ISpiderReportable {  protected IWorkloadStorable _workload;  protected SpiderWorker _pool[];  protected boolean _worldSpider;  protected ISpiderReportable _manager;  protected boolean _halted = false;  protected SpiderDone _done = new SpiderDone();  protected int _maxBodySize;  /**   * This constructor prepares the spider to begin.   * Basic information required to begin is passed.   * This constructor uses the internal workload manager.   *   * @param manager The object that this spider reports its findings to.   * @param url The URL that the spider should begin at.   * @param http The HTTP handler used by this spider.   * @param poolsize The size of the thread pool.   */  public Spider(ISpiderReportable manager,String url,HTTP http,int poolSize)  {    this(manager,url,http,poolSize,new SpiderInternalWorkload());  }  /**   * This constructor prepares the spider to begin.   * Basic information required to begin is passed.   * This constructor allows the user to specify a   * customized workload manager.   *   * @param manager The object that this spider reports its findings to.   * @param url The URL that the spider should begin at.   * @param http The HTTP handler used by this spider.   * @param poolsize The size of the thread pool.   * @param w A customized workload manager.   */  public Spider(ISpiderReportable manager,String url,HTTP http,int poolSize,IWorkloadStorable w)  {    _manager = manager;    _worldSpider = false;    _pool = new SpiderWorker[poolSize];    for ( int i=0;i<_pool.length;i++ ) {      HTTP hc = http.copy();      _pool[i] = new SpiderWorker( this,hc );    }    _workload = w;    if ( url.length()>0 ) {      _workload.clear();      addWorkload(url);    }  }  /**   * Get the SpiderDone object used by this spider   * to determine when it is done.   *   * @return Returns true if the spider is done.   */  public SpiderDone getSpiderDone()  {    return _done;  }  /**   * The main loop of the spider. This can be called   * directly, or the start method can be called to   * run as a background thread. This method will not   * return until there is no work remaining for the   * spider.   */  public void run()  {    if ( _halted )      return;    for ( int i=0;i<_pool.length;i++ )      _pool[i].start();    try {      _done.waitBegin();      _done.waitDone();      Log.log(Log.LOG_LEVEL_NORMAL,"Spider has no work.");      spiderComplete();      for ( int i=0;i<_pool.length;i++ ) {        _pool[i].interrupt();        _pool[i].join();        _pool[i] = null;      }    } catch ( Exception e ) {      Log.logException("Exception while starting spider", e);    }  }  /**   * This method is called to get a workload   * from the workload manager. If no workload   * is available, this method will block until   * there is one.   *   * @return Returns the next URL to be spidered.   */  synchronized public String getWorkload()  {    try {      for ( ;; ) {        if ( _halted )          return null;        String w = _workload.assignWorkload();        if ( w!=null )          return w;        wait();      }    } catch ( java.lang.InterruptedException e ) {    }    return null;  }  /**   * Called to add a workload to the workload manager.   * This method will release a thread that was waiting   * for a workload. This method will do nothing if the   * spider has been halted.   *   * @param url The URL to be added to the workload.   */  synchronized public void addWorkload(String url)  {    if ( _halted )      return;    _workload.addWorkload(url);    notify();  }  /**   * Called to specify this spider as either a world   * or site spider. See getWorldSpider for more information   * about what a world spider is.   *   * @param b True to be a world spider.   */  public void setWorldSpider(boolean b)  {    _worldSpider = b;  }  /**   * Returns true if this is a world spider, a world   * spider does not restrict itself to a single site   * and will likely go on "forever".   *   * @return Returns true if the spider is done.   */  public boolean getWorldSpider()  {    return _worldSpider;  }  /**   * Called when the spider finds an internal   * link. An internal link shares the same   * host address as the URL that started   * the spider. This method hands the link off   * to the manager and adds the URL to the workload   * if necessary.   *   * @param url The URL that was found by the spider.   * @return true - The spider should add this URL to the workload.   * false - The spider should not add this URL to the workload.   */  synchronized public boolean foundInternalLink(String url)  {    if ( _manager.foundInternalLink(url) )      addWorkload(url);    return true;  }  /**   * Called when the spider finds an external   * link. An external link does not share the   * same host address as the URL that started   * the spider. This method hands the link off   * to the manager and adds the URL to the workload   * if necessary. If this is a world spider, then   * external links are treated as internal links.   *   * @param url The URL that was found by the spider.   * @return true - The spider should add this URL to the workload.   * false - The spider should not add this URL to the workload.   */  synchronized public boolean foundExternalLink(String url)  {    if ( _worldSpider ) {      foundInternalLink(url);      return true;    }    if ( _manager.foundExternalLink(url) )      addWorkload(url);    return true;  }  /**   * Called when the spider finds a type of   * link that does not point to another HTML   * page(for example a mailto link). This method   * hands the link off to the manager and adds   * the URL to the workload if necessary.   *   * @param url The URL that was found by the spider.   * @return true - The spider should add this URL to the workload.   * false - The spider should not add this URL to the workload.   */  synchronized public boolean foundOtherLink(String url)  {    if ( _manager.foundOtherLink(url) )      addWorkload(url);    return true;  }  /**   * Called to actually process a page. This is where the   * work actually done by the spider is usually preformed.   *   * @param page The page contents.   * @param error true - This page resulted in an HTTP error.   * false - This page downloaded correctly.   */  synchronized public void processPage(HTTP page)  {    _manager.processPage(page);  }  /**   * This method is called by the spider to determine if   * query strings should be removed. By default the spider   * always chooses to remove query strings, so true is   * returned.   *   * @return true - Query string should be removed.   * false - Leave query strings as is.   */  synchronized public boolean getRemoveQuery()  {    return true;  }  /**   * Called to request that a page be processed.   * This page was just downloaded by the spider.   * This messages passes this call on to its   * manager.   *   * @param page The page contents.   * @param error true - This page resulted in an HTTP error.   * false - This page downloaded correctly.   */  synchronized public void completePage(HTTP page,boolean error)  {    _workload.completeWorkload(page.getURL(),error);  }  /**   * Called when the spider has no more work. This method   * just passes this event on to its manager.   */  synchronized public void spiderComplete()  {    _manager.spiderComplete();  }  /**   * Called to cause the spider to halt. The spider will not halt   * immediately. Once the spider is halted the run method will   * return.   */  synchronized public void halt()  {    _halted = true;    _workload.clear();    notifyAll();  }  /**   * Determines if the spider has been halted.   *   * @return Returns true if the spider has been halted.   */  public boolean isHalted()  {    return _halted;  }  /**   * This method will set the maximum body size   * that will be downloaded.   *   * @param i The maximum body size, or -1 for unlifted.   */  public void setMaxBody(int mx)  {    _maxBodySize = mx;    for ( int i=0;i<_pool.length;i++ )      _pool[i].getHTTP().setMaxBody(mx);  }  /**   * This method will return the maximum body size   * that will be downloaded.   *   * @return The maximum body size, or -1 for unlifted.   */  public int getMaxBody()  {    return _maxBodySize;  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久亚洲毛片| 911国产精品| 欧美日韩一区不卡| 精品欧美乱码久久久久久1区2区| 国产欧美日韩视频一区二区| 天堂va蜜桃一区二区三区 | 国产亚洲欧美日韩日本| 成人欧美一区二区三区小说| 麻豆91在线看| 欧美无人高清视频在线观看| 欧美激情一区二区三区在线| 男女视频一区二区| 欧美又粗又大又爽| 亚洲第一二三四区| 亚洲成人av电影在线| 精品制服美女丁香| 在线不卡免费欧美| 亚洲精品国产视频| 99re这里只有精品6| 久久毛片高清国产| 免费观看一级欧美片| 在线电影国产精品| 亚洲va国产va欧美va观看| 99久久精品免费| 国产女主播在线一区二区| 国产一区二区三区黄视频| 日韩午夜激情av| 麻豆一区二区三区| 51精品秘密在线观看| 午夜精品久久久久久久99樱桃| 91成人在线精品| 亚洲一级电影视频| 欧美在线一区二区三区| 亚洲精品你懂的| 欧美色涩在线第一页| 一区二区免费看| 欧美性感一类影片在线播放| 有坂深雪av一区二区精品| 色综合久久天天| 一区二区三区欧美日韩| 91国模大尺度私拍在线视频| 亚洲综合成人在线| 在线日韩一区二区| 亚洲狠狠爱一区二区三区| 欧美日韩久久一区| 久久国内精品自在自线400部| 日韩欧美电影一区| 韩国三级电影一区二区| 国产精品私人自拍| 一本到三区不卡视频| 丰满少妇在线播放bd日韩电影| 久久婷婷国产综合国色天香| 国产成人免费在线观看不卡| 亚洲精品国产一区二区精华液 | 国产日产欧美一区二区三区 | 91黄色激情网站| 水蜜桃久久夜色精品一区的特点| 91精品国产综合久久精品麻豆| 免费在线看成人av| 国产人妖乱国产精品人妖| 99久久精品国产网站| 亚洲a一区二区| 欧美精品一区二区三区高清aⅴ | 欧美日韩国产首页| 日韩精品视频网站| 欧美变态tickling挠脚心| 成人性色生活片| 一级日本不卡的影视| 日韩一级视频免费观看在线| 国产一区二区三区四区五区入口| 国产精品久久久久7777按摩| 欧美精品免费视频| 国产精品一级在线| 亚洲欧洲中文日韩久久av乱码| 欧美一级日韩免费不卡| 丁香婷婷综合网| 喷水一区二区三区| 中文字幕在线观看一区| 色妹子一区二区| 国产一区二三区| 亚洲综合激情另类小说区| 国产情人综合久久777777| 欧美日韩和欧美的一区二区| 从欧美一区二区三区| 日本特黄久久久高潮| 亚洲欧美另类在线| 久久久精品tv| 日韩一二三区视频| 日本韩国一区二区三区视频| 国产高清精品网站| 午夜影院久久久| 亚洲精品成人少妇| 国产亚洲福利社区一区| 制服丝袜一区二区三区| 色婷婷久久综合| 成人免费va视频| 国产美女精品在线| 日韩精品久久理论片| 一区二区三区蜜桃| 中文字幕成人在线观看| 久久综合色天天久久综合图片| 欧美日本一区二区| 日本丰满少妇一区二区三区| 99麻豆久久久国产精品免费| 成人午夜激情视频| 国产成人免费在线观看不卡| 狠狠色狠狠色综合日日91app| 美国十次综合导航| 日本成人在线电影网| 日韩国产在线观看| 一片黄亚洲嫩模| 一区二区不卡在线视频 午夜欧美不卡在| 国产精品无码永久免费888| 久久美女艺术照精彩视频福利播放| 日韩一区二区在线观看视频播放| 欧美日韩国产一区二区三区地区| 欧洲中文字幕精品| 在线看国产一区| 欧美在线免费观看视频| 欧美色图激情小说| 欧美日韩高清一区| 538prom精品视频线放| 91精品麻豆日日躁夜夜躁| 91精品国产麻豆国产自产在线 | 视频一区视频二区中文字幕| 午夜一区二区三区视频| 日本一不卡视频| 久久国产精品免费| 九九**精品视频免费播放| 国产精品自拍网站| 国产成人午夜精品影院观看视频| 成人黄色在线看| 色综合天天狠狠| 欧美视频完全免费看| 56国语精品自产拍在线观看| 欧美成人a∨高清免费观看| 精品伦理精品一区| 国产精品毛片高清在线完整版| 亚洲人成在线播放网站岛国| 亚洲激情在线激情| 日韩黄色免费电影| 国产在线播放一区二区三区| 99国产麻豆精品| 8v天堂国产在线一区二区| 2022国产精品视频| 亚洲人成在线观看一区二区| 天天影视涩香欲综合网| 国产精品一区2区| 99久久国产综合精品色伊| 在线观看91av| 国产精品麻豆网站| 视频一区中文字幕国产| 成人免费av资源| 欧美日韩另类一区| 国产亚洲精品久| 亚洲国产色一区| 国产成人免费av在线| 欧美日高清视频| 欧美国产国产综合| 日韩电影免费在线| 丁香婷婷综合色啪| 7777精品伊人久久久大香线蕉| 日本一区二区视频在线| 首页国产欧美日韩丝袜| 成人在线视频一区| 91精品国产色综合久久久蜜香臀| 国产精品卡一卡二卡三| 婷婷综合另类小说色区| 不卡欧美aaaaa| 欧美刺激脚交jootjob| 亚洲综合色成人| 成人免费视频视频| 日韩欧美亚洲另类制服综合在线| 亚洲三级在线观看| 国产成人午夜精品5599| 欧美一区二区视频在线观看2022| 中文字幕在线观看一区二区| 国产乱子伦一区二区三区国色天香| 在线亚洲一区观看| 国产日产精品1区| 极品少妇一区二区| 777色狠狠一区二区三区| 亚洲色大成网站www久久九九| 韩国中文字幕2020精品| 日韩欧美一二三区| 日韩电影免费在线| 欧美午夜一区二区| 亚洲天堂网中文字| 成人a区在线观看| 久久先锋影音av鲁色资源网| 青椒成人免费视频| 91精品婷婷国产综合久久竹菊| 亚洲欧美日韩一区二区三区在线观看| 国产精品911| 精品久久久久久久久久久院品网 | 一区二区不卡在线播放 | 最新热久久免费视频| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美国产国产综合| 国产经典欧美精品|