KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > core > task > WorkerTask


1 package net.javacoding.jspider.core.task;
2
3 /**
4  * Interface that will be implemented upon each class that represents a
5  * JSpider workertask that needs to be executed by a Worker Thread.
6  *
7  * JSpider has two types of tasks: spider tasks (that fetch data from a
8  * web server), and thinker tasks (that interpret data, take decision,
9  * etc...)
10  *
11  * $Id: WorkerTask.java,v 1.5 2003/04/25 21:29:02 vanrogu Exp $
12  *
13  * @author Günther Van Roey
14  */

15 public interface WorkerTask extends Task {
16
17     /**
18      * Task type that is used for every task that will require the fetching
19      * of data from a site.
20      */

21     public static final int WORKERTASK_SPIDERTASK = 1;
22
23     /**
24      * Task type used for all tasks that don't require any fetching of data
25      */

26     public static final int WORKERTASK_THINKERTASK = 2;
27
28     /**
29      * Returns the type of the task - spider or thinker.
30      * @return the type of the task
31      */

32     public int getType ( );
33
34     /**
35      * Allows some work to be done before the actual Task is carried out.
36      * During the invocation of prepare, the WorkerThread's state will be
37      * WORKERTHREAD_BLOCKED.
38      */

39     public void prepare ( );
40
41     /**
42      * Allows us to put common code in the abstract base class.
43      */

44     public void tearDown ( );
45
46 }
47
Popular Tags