WorkerTask.java
上传用户:qing5858
上传日期:2015-10-27
资源大小:6056k
文件大小:1k
源码类别:

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.core.task;
  2. /**
  3.  * Interface that will be implemented upon each class that represents a
  4.  * JSpider workertask that needs to be executed by a Worker Thread.
  5.  *
  6.  * JSpider has two types of tasks: spider tasks (that fetch data from a
  7.  * web server), and thinker tasks (that interpret data, take decision,
  8.  * etc...)
  9.  *
  10.  * $Id: WorkerTask.java,v 1.5 2003/04/25 21:29:02 vanrogu Exp $
  11.  *
  12.  * @author G黱ther Van Roey
  13.  */
  14. public interface WorkerTask extends Task {
  15.     /**
  16.      * Task type that is used for every task that will require the fetching
  17.      * of data from a site.
  18.      */
  19.     public static final int WORKERTASK_SPIDERTASK = 1;
  20.     /**
  21.      * Task type used for all tasks that don't require any fetching of data
  22.      */
  23.     public static final int WORKERTASK_THINKERTASK = 2;
  24.     /**
  25.      * Returns the type of the task - spider or thinker.
  26.      * @return the type of the task
  27.      */
  28.     public int getType ( );
  29.     /**
  30.      * Allows some work to be done before the actual Task is carried out.
  31.      * During the invocation of prepare, the WorkerThread's state will be
  32.      * WORKERTHREAD_BLOCKED.
  33.      */
  34.     public void prepare ( );
  35.     /**
  36.      * Allows us to put common code in the abstract base class.
  37.      */
  38.     public void tearDown ( );
  39. }