Java Reference
In-Depth Information
Figure 14.1: URL State Diagram
�����
������������
���������������
�������������
������
�������
������������
����������������
�����������������
����������
�������
��������������
���������
���������������
����
���
�����
���������
������������
���������
����������
Any class that is to serve as a workload manager must implement the
WorkloadManager interface. This interface defines the methods and functions neces-
sary to track a list of URLs for the spider. The workload manager class is shown in Listing
14.6.
Listing 14.6: Workload Manager (WorkloadManager.java)
package com.heatonresearch.httprecipes.spider.workload;
import java.net.*;
import java.util.concurrent.*;
import com.heatonresearch.httprecipes.spider.*;
public interface WorkloadManager {
/**
* Add the specified URL to the workload.
*
* @param url
* The URL to be added.
* @param source
* The page that contains this URL.
* @param depth
* The depth of this URL.
* @return True if the URL was added, false otherwise.
* @throws WorkloadException
*/
public boolean add(URL url, URL source, int depth)
throws WorkloadException;
 
Search WWH ::




Custom Search