Author: bdaw
Date: 2007-09-05 08:52:20 -0400 (Wed, 05 Sep 2007)
New Revision: 8174
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
Log:
JBPORTAL-1535 - Make GG xml retrieval timeout parameterizable
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-09-05
12:45:05 UTC (rev 8173)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-09-05
12:52:20 UTC (rev 8174)
@@ -45,7 +45,7 @@
URL url = tcl.getResource("google/queryresult1.xml");
assertNotNull(url);
GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
- GGQueryResult result = builder.build();
+ GGQueryResult result = builder.build(5000);
assertNotNull(result);
Iterator i = result.entries();
assertNotNull(i);
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05
12:45:05 UTC (rev 8173)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05
12:52:20 UTC (rev 8174)
@@ -64,7 +64,7 @@
private ExecutorService executor;
/** . */
- private int connectionTimeout = 500;
+ private int connectionTimeout = 5000;
/** . */
private static final Collection CATEGORIES = Collections.unmodifiableList(new
CollectionBuilder()
@@ -280,7 +280,7 @@
public Object call() throws MalformedURLException
{
- return new GGQueryResultBuilder(query, getConnectionTimeout()).build();
+ return new GGQueryResultBuilder(query).build(getConnectionTimeout());
}
}
}
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05
12:45:05 UTC (rev 8173)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05
12:52:20 UTC (rev 8174)
@@ -66,7 +66,7 @@
/** . */
private final URL url;
- public GGQueryResultBuilder(GGQuery query, int connectionTimeout) throws
MalformedURLException
+ public GGQueryResultBuilder(GGQuery query) throws MalformedURLException
{
if (query == null)
{
@@ -85,7 +85,7 @@
this.url = url;
}
- public GGQueryResult build()
+ public GGQueryResult build(int connectionTimeout)
{
try
{
@@ -93,7 +93,7 @@
byte[] bytes;
if ("http".equals(url.getProtocol()))
{
- bytes = URLTools.performGET(url, 5000, 5000);
+ bytes = URLTools.performGET(url, connectionTimeout, connectionTimeout);
}
else
{
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05
12:45:05 UTC (rev 8173)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05
12:52:20 UTC (rev 8174)
@@ -35,7 +35,7 @@
<init-param>
<description>Connection timeout when retreiving gadgets from google
directory</description>
<name>connectionTimeout</name>
- <value>500</value>
+ <value>5000</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
Show replies by date