[portal-commits] JBoss Portal SVN: r8953 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget/google and 2 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Nov 15 12:02:03 EST 2007


Author: emuckenhuber
Date: 2007-11-15 12:02:02 -0500 (Thu, 15 Nov 2007)
New Revision: 8953

Modified:
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/ExpiringFutureTask.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
Log:
Eviction thread timing update

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java	2007-11-15 17:02:02 UTC (rev 8953)
@@ -22,6 +22,8 @@
  ******************************************************************************/
 package org.jboss.portal.widget;
 
+import java.util.concurrent.TimeUnit;
+
 import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
@@ -66,6 +68,7 @@
       {
          try
          {
+            // time in millisecond
             provider.setConnectionTimeout(Integer.parseInt(timeout));
          }
          catch (NumberFormatException e)
@@ -79,7 +82,9 @@
       {
          try
          {
-            provider.setQueryExpiration(Integer.parseInt(queryExpiration));
+            // time in minutes
+            int expiration = Integer.parseInt(queryExpiration) * 60;
+            provider.setQueryExpiration(TimeUnit.MILLISECONDS.convert(expiration, TimeUnit.SECONDS));
          }
          catch(NumberFormatException e)
          {
@@ -92,7 +97,9 @@
       {
          try
          {
-            provider.setEntryExpiration(Integer.parseInt(entryExpiration));
+            // time in minutes
+            int expiration = Integer.parseInt(entryExpiration) * 60;
+            provider.setEntryExpiration(TimeUnit.MILLISECONDS.convert(expiration, TimeUnit.SECONDS));
          }
          catch(NumberFormatException e)
          {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java	2007-11-15 17:02:02 UTC (rev 8953)
@@ -55,17 +55,17 @@
    /** The scheduled executor */
    protected ScheduledExecutorService scheduledExecutor;
    
-   /** The entry expiration time in millis */
-   protected long entryExpiration = TimeUnit.MILLISECONDS.convert(120, TimeUnit.SECONDS);
+   /** The entry expiration time in millis (default: 1 day) */
+   protected long entryExpiration = TimeUnit.MILLISECONDS.convert(86400, TimeUnit.SECONDS);
    
-   /** The query expiration time in millis */
-   protected long queryExpiration = TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS);
+   /** The query expiration time in millis (default: 15 minutes) */
+   protected long queryExpiration = TimeUnit.MILLISECONDS.convert(900, TimeUnit.SECONDS);
    
    /** Fetch all widgets in on the directory lookup */
    private boolean fetchWidgetsOnDirectoryLookup = false;
    
    /** The connection timeout */
-   protected long connectionTimeout;
+   protected long connectionTimeout = 5000;
    
    /** Eviction thread timing */
    protected long timing = TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS);

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/ExpiringFutureTask.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/ExpiringFutureTask.java	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/ExpiringFutureTask.java	2007-11-15 17:02:02 UTC (rev 8953)
@@ -48,7 +48,7 @@
       }
       if (this.isDone())
       {
-         return System.currentTimeMillis() > expires ? true : false;
+         return System.currentTimeMillis() > expires;
       }
       else
       {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java	2007-11-15 17:02:02 UTC (rev 8953)
@@ -131,7 +131,6 @@
             String defaultValue = prefInfo.getDefaultValue() != null ? prefInfo.getDefaultValue() : "";
             String[] values = (String[])parameters.get(prefName);
             String value = values != null ? values[0] : defaultValue;
-            System.out.println("value: " + value);
             // if value is present and not a default parameter
             if (value != null && !defaultValue.equals(value))
             {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml	2007-11-15 17:02:02 UTC (rev 8953)
@@ -32,6 +32,16 @@
       <portlet-name>NetvibesWidgetPortlet</portlet-name>
       <display-name>Netvibes Widget Portlet</display-name>
       <portlet-class>org.jboss.portal.widget.netvibes.NetvibesWidgetPortlet</portlet-class>
+      <init-param>
+         <description>Connection timeout when retreiving gadgets from google directory (in milliseconds)</description>
+         <name>connectionTimeout</name>
+         <value>5000</value>
+      </init-param>
+      <init-param>
+         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 1 day.</description>
+         <name>entryExpiration</name>
+         <value>1440</value>
+      </init-param>
       <supports>
          <mime-type>text/html</mime-type>
          <portlet-mode>VIEW</portlet-mode>

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml	2007-11-15 16:58:54 UTC (rev 8952)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml	2007-11-15 17:02:02 UTC (rev 8953)
@@ -33,10 +33,20 @@
       <display-name>Google Widget Portlet</display-name>
       <portlet-class>org.jboss.portal.widget.google.GGWidgetPortlet</portlet-class>
       <init-param>
-         <description>Connection timeout when retreiving gadgets from google directory</description>
+         <description>Connection timeout when retreiving gadgets from google directory (in milliseconds)</description>
          <name>connectionTimeout</name>
          <value>5000</value>
       </init-param>
+      <init-param>
+         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 1 day.</description>
+         <name>entryExpiration</name>
+         <value>1440</value>
+      </init-param>
+      <init-param>
+         <description>Time until a query expires. Default value is 15 minutes.</description>
+         <name>queryExpiration</name>
+         <value>900</value>
+      </init-param>
       <supports>
          <mime-type>text/html</mime-type>
          <portlet-mode>VIEW</portlet-mode>




More information about the portal-commits mailing list