com.arsdigita.util.url
Class URLPool

java.lang.Object
  extended bycom.arsdigita.util.url.URLPool

public class URLPool
extends Object


Constructor Summary
URLPool()
          Create a new URLPool with a default poolsize of 10 and a default timeout of 4 seconds.
URLPool(int poolsize)
          Create a new URLPool with a default timeout of 4 seconds.
URLPool(int threadCount, long timeout)
          Create a new URLPool with a default timeout of 4 seconds.
 
Method Summary
 String fetchURL(String url)
          Deprecated. Use fetchURLData(String) instead
 URLData fetchURLData(String url)
          fetches the remote URL, returning the data from the page, or null if an error occurred.
 int getMaxThreadCount()
          Returns the thread count - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.
 long getTimeOut()
          Returns the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.
 void setMaxThreadCount(int maxThreadCount)
          Sets the thread count - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.
 void setTimeOut(long timeOut)
          Sets the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLPool

public URLPool()
Create a new URLPool with a default poolsize of 10 and a default timeout of 4 seconds.


URLPool

public URLPool(int poolsize)
Create a new URLPool with a default timeout of 4 seconds.

Parameters:
poolsize - - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.

URLPool

public URLPool(int threadCount,
               long timeout)
Create a new URLPool with a default timeout of 4 seconds.

Parameters:
threadCount - - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.
timeout - - timeout in milliseconds to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.
Method Detail

getMaxThreadCount

public int getMaxThreadCount()
Returns the thread count - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.

Returns:
the thread count - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.

setMaxThreadCount

public void setMaxThreadCount(int maxThreadCount)
Sets the thread count - maximum number of threads allowed to be running at any given time, any subsequent requests for urls are queued until a thread becomes available.

Parameters:
maxThreadCount - the maximum number of threads allowed to be running at any given time

getTimeOut

public long getTimeOut()
Returns the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.

Returns:
the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.

setTimeOut

public void setTimeOut(long timeOut)
Sets the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.

Parameters:
timeOut - the timeout to use when fetching URLs to prevent a slow remote server from delaying the calling application indefinitely.

fetchURL

public String fetchURL(String url)
Deprecated. Use fetchURLData(String) instead

fetches the remote URL, returning the data from the page, or null if an error occurred.

Parameters:
url - The URL to fetch data from
Returns:
Data from the URL, or null if unable to fetch.

fetchURLData

public URLData fetchURLData(String url)
fetches the remote URL, returning the data from the page, or null if an error occurred.

Parameters:
url - The URL to fetch data from
Returns:
Data from the URL, or null if unable to fetch.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC