prevent exception when no default timeout is specified
[jalview.git] / src / jalview / bin / Cache.java
index acf1499..0744cd9 100755 (executable)
@@ -53,6 +53,7 @@ import org.apache.log4j.*;
  * </li><li>SHOW_QUALITY show alignment quality annotation
  * </li><li>SHOW_ANNOTATIONS show alignment annotation rows
  * </li><li>SHOW_CONSERVATION show alignment conservation annotation
+ * </li><li>CENTRE_COLUMN_LABELS centre the labels at each column in a displayed annotation row 
  * </li><li>DEFAULT_COLOUR default colour scheme to apply for a new alignment
  * </li><li>DEFAULT_FILE_FORMAT file format used to save 
  * </li><li>STARTUP_FILE file loaded on startup (may be a fully qualified url)
@@ -84,6 +85,7 @@ import org.apache.log4j.*;
  * </li><li>DAS_REGISTRY_URL the registry to query
  * </li><li>DEFAULT_BROWSER for unix
  * </li><li>DAS_ACTIVE_SOURCE list of active sources
+ * </li><li>SHOW_MEMUSAGE boolean show memory usage and warning indicator on desktop (false) 
  * </li><li> 
  * </li>
  * 
@@ -101,7 +103,7 @@ public class Cache
   /**
    * property giving log4j level for AXIS loggers
    */
-  public static final String AXISLOGLEVEL = "logs.Castor.level";
+  public static final String AXISLOGLEVEL = "logs.Axis.level";
   /**
    * property giving log4j level for Jalview Log
    */
@@ -138,6 +140,9 @@ public class Cache
       lcastor = Logger.getLogger("org.exolab.castor.xml");
       lcastor.setLevel(Level.toLevel(Cache.getDefault("logs.Castor.Level",
               Level.INFO.toString())));
+      //lcastor = Logger.getLogger("org.exolab.castor.xml.Marshaller");
+      //lcastor.setLevel(Level.toLevel(Cache.getDefault("logs.Castor.Level",
+      //        Level.INFO.toString())));
       jalview.bin.Cache.log.setLevel(Level.toLevel(Cache.getDefault(
           "logs.Jalview.level",
           Level.INFO.toString())));
@@ -233,9 +238,16 @@ public class Cache
       {
         public void run()
         {
+          String orgtimeout = System.getProperty("sun.net.client.defaultConnectTimeout");
+          if (orgtimeout==null)
+          {
+            orgtimeout="30";
+            System.out.println("# INFO: Setting default net timeout to "+orgtimeout+" seconds.");
+          }
           String jnlpVersion = null;
           try
           {
+            System.setProperty("sun.net.client.defaultConnectTimeout", "5000");
             java.net.URL url = new java.net.URL(
                 "http://www.jalview.org/webstart/jalview.jnlp");
             BufferedReader in = new BufferedReader(new InputStreamReader(url.
@@ -256,9 +268,11 @@ public class Cache
           }
           catch (Exception ex)
           {
+            System.out.println("Non-fatal exceptions when checking version at www.jalview.org :");
             System.out.println(ex);
             jnlpVersion = getProperty("VERSION");
           }
+          System.setProperty("sun.net.client.defaultConnectTimeout", orgtimeout);
 
           setProperty("LATEST_VERSION", jnlpVersion);
         }