net.sf.urlchecker.commands
Class CheckUrlsCommand
java.lang.Object
net.sf.urlchecker.commands.AbstractCommand
net.sf.urlchecker.commands.CheckUrlsGeneric<org.apache.commons.httpclient.HttpClient>
net.sf.urlchecker.commands.CheckUrlsCommand
- All Implemented Interfaces:
- Command
public class CheckUrlsCommand
- extends CheckUrlsGeneric<org.apache.commons.httpclient.HttpClient>
The main Command of the URLChecker using the old httpClient from jakarta
commons. If the context was initialized for multi-threaded use, this class
will spawn one thread for each result. Each thread will use the
CheckUrlsProcess
which in turn will try to verify the availability of
one URL.
$Id: CheckUrlsCommand.java 181 2010-12-12 23:39:00Z georgosn $
- Version:
- $LastChangedRevision: 181 $
- Author:
- $LastChangedBy: georgosn $
Constructor Summary |
CheckUrlsCommand(Command successor,
org.apache.commons.httpclient.HttpClient newClient)
Instantiates a new check URLs command. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CheckUrlsCommand
public CheckUrlsCommand(Command successor,
org.apache.commons.httpclient.HttpClient newClient)
- Instantiates a new check URLs command. The successor parameter can be
null if no successor is needed.
- Parameters:
successor
- the successor commandnewClient
- the client to be used
isMultithreaded
public boolean isMultithreaded()
- Checks if the client is set up for multithreaded operation. It is left to
the subclasses to define this method as different clients will provide
different ways to determine the state of the ConnectionManager.
Checks if is multithreaded.
- Specified by:
isMultithreaded
in class CheckUrlsGeneric<org.apache.commons.httpclient.HttpClient>
- Returns:
- if is multithreaded.
multithreadedExecution
protected void multithreadedExecution(Context context,
Iterator<Result> iter)
throws org.apache.commons.configuration.ConfigurationException
- Spawns threads to check individual URLs.
Spawns threads to check individual URLs.
- Specified by:
multithreadedExecution
in class CheckUrlsGeneric<org.apache.commons.httpclient.HttpClient>
- Parameters:
context
- , the enginge's contextiter
- , the valid context results iterator to check over the
Internet.
- Throws:
org.apache.commons.configuration.ConfigurationException
- the configuration exception
singlethreadedExecution
protected void singlethreadedExecution(Iterator<Result> iter)
throws org.apache.commons.configuration.ConfigurationException
- Executes checking using one thread for all URLs to check.
Executes checking using one thread for all URLs to check.
- Specified by:
singlethreadedExecution
in class CheckUrlsGeneric<org.apache.commons.httpclient.HttpClient>
- Parameters:
iter
- , the valid context results iterator to check over the
Internet.
- Throws:
org.apache.commons.configuration.ConfigurationException
- the configuration exception.
Copyright © 2010 Nikolaos Georgosopoulos. All Rights Reserved.