Java Reference
In-Depth Information
* @return The next URL to work on,
* @throws WorkloadException
* Thrown if the next URL could not be obtained.
*/
public URL getWork() throws WorkloadException
{
URL url = null;
do
{
url = getWorkInternal();
if (url == null)
{
if (workloadEmpty())
{
break;
}
}
} while (url == null);
return url;
}
/**
* Setup this workload manager for the specified spider.
*
* @param spider
* The spider using this workload manager.
* @throws WorkloadException
* Thrown if there is an error setting up the
* workload manager.
*/
public void init(Spider spider) throws WorkloadException
{
this.addLock = new Semaphore(1);
this.workLatch = new CountDownLatch(1);
this.workLatch.countDown();
this.driver = spider.getOptions().dbClass;
this.url = spider.getOptions().dbURL;
this.uid = spider.getOptions().dbUID;
this.pwd = spider.getOptions().dbPWD;
this.statements.add(this.stmtClear =
new RepeatableStatement(this.holder.getSQLClear()));
this.statements.add(this.stmtClear2 =
Search WWH ::




Custom Search