com.torrentMech.crawler
Class TorrentCrawler

java.lang.Object
  extended by com.torrentMech.crawler.TorrentCrawler
All Implemented Interfaces:
java.lang.Runnable

public class TorrentCrawler
extends java.lang.Object
implements java.lang.Runnable

TorrentCrawler is a web-crawling thread that works in tandem with various "plugins" to pull torrent files off the web. To crawl for torrents, all the plugins from the com.torrentMech.crawler.plugins package are read in and their classpaths stored in an array. Each plugin is then dynamically loaded and started in its own thread. The plugin is an implementation of the com.torrentMech.crawler.Plugin interface. A plugin will contain the parsers needed for a particular web page or site.
TorrentCrawler's job is three-fold.     


This system essentially isolates the crawling status reporting and DBMS work to one class and leaves the unique parsing code to the plugins.

Version:
.01 alpha
Author:
Will Bailey

Field Summary
private  java.io.File[] pluginPaths
          Internally stored array of Java classpaths to the plugins contained in the com.torrentMech.crawler.plugins package.
 
Constructor Summary
TorrentCrawler()
          Creates a new TorrentCrawler instance.
 
Method Summary
static void main(java.lang.String[] a)
           
 void run()
          The implementation of the java.lang.Runnable interface that starts the launching of the plugins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginPaths

private java.io.File[] pluginPaths
Internally stored array of Java classpaths to the plugins contained in the com.torrentMech.crawler.plugins package.

Constructor Detail

TorrentCrawler

public TorrentCrawler()
Creates a new TorrentCrawler instance. The constructor searches the com.torrentMech.crawler.plugins package and stores every class file found there that implements the com.torrentMech.crawler.Plugin interface in an array of classpaths. These classpaths will later be used to dynamically load each plugin.

Method Detail

main

public static void main(java.lang.String[] a)

run

public void run()
The implementation of the java.lang.Runnable interface that starts the launching of the plugins. Each plugin is dynamically loaded and started in a new thread. The status of these plugins is queried from time to time throughout their lifecycle and reported. When completed, the plugins torrents are decoded and stored in the DBMS.

Specified by:
run in interface java.lang.Runnable