| java.lang.Object org.archive.crawler.fetcher.HeritrixProtocolSocketFactory
HeritrixProtocolSocketFactory | public class HeritrixProtocolSocketFactory implements ProtocolSocketFactory(Code) | | Version of protocol socket factory that tries to get IP from heritrix IP
cache -- if its been set into the HttpConnectionParameters.
Copied the guts of DefaultProtocolSocketFactory. This factory gets
setup by
FetchHTTP .
author: stack version: $Date: 2006-08-29 22:47:03 +0000 (Tue, 29 Aug 2006) $, $Revision: 4553 $ |
Method Summary | |
public Socket | createSocket(String host, int port, InetAddress localAddress, int localPort) | public Socket | createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) Attempts to get a new socket connection to the given host within the
given time limit.
This method employs several techniques to circumvent the limitations
of older JREs that do not support connect timeout. | public Socket | createSocket(String host, int port) | public boolean | equals(Object obj) All instances of DefaultProtocolSocketFactory are the same.
Parameters: obj - Object to compare. | static InetAddress | getHostAddress(ServerCache cache, String host) Get host address using first the heritrix cache of addresses, then,
failing that, go to the dnsjava cache.
Default access and static so can be used by other classes in this
package.
Parameters: host - Host whose address we're to fetch. | public int | hashCode() All instances of DefaultProtocolSocketFactory have the same hash code. |
HeritrixProtocolSocketFactory | public HeritrixProtocolSocketFactory()(Code) | | Constructor.
|
createSocket | public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException(Code) | | Attempts to get a new socket connection to the given host within the
given time limit.
This method employs several techniques to circumvent the limitations
of older JREs that do not support connect timeout. When running in
JRE 1.4 or above reflection is used to call
Socket#connect(SocketAddress endpoint, int timeout) method. When
executing in older JREs a controller thread is executed. The
controller thread attempts to create a new socket within the given
limit of time. If socket constructor does not return until the
timeout expires, the controller terminates and throws an
ConnectTimeoutException
Parameters: host - the host name/IP Parameters: port - the port on the host Parameters: localAddress - the local host name/IP to bind the socket to Parameters: localPort - the port on the local machine Parameters: params - HttpConnectionParams Http connection parameters Socket a new socket throws: IOException - if an I/O error occurs while creating the socket throws: UnknownHostException - if the IP address of the host cannot be throws: IOException - if an I/O error occurs while creating the socket throws: UnknownHostException - if the IP address of the host cannot bedetermined throws: ConnectTimeoutException - if socket cannot be connected within thegiven time limit since: 3.0 |
equals | public boolean equals(Object obj)(Code) | | All instances of DefaultProtocolSocketFactory are the same.
Parameters: obj - Object to compare. True if equal |
getHostAddress | static InetAddress getHostAddress(ServerCache cache, String host) throws IOException(Code) | | Get host address using first the heritrix cache of addresses, then,
failing that, go to the dnsjava cache.
Default access and static so can be used by other classes in this
package.
Parameters: host - Host whose address we're to fetch. an IP address for this host or null if one can't be foundin caches. exception: IOException - If we fail to get host IP from ServerCache. |
hashCode | public int hashCode()(Code) | | All instances of DefaultProtocolSocketFactory have the same hash code.
Hash code for this object. |
|
|