1.5 annotation fix
[jalview.git] / src / jalview / ws / jws2 / Jws2Discoverer.java
index 2230d11..2528308 100644 (file)
@@ -70,7 +70,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   Thread oldthread = null;
 
-  @Override
   public void run()
   {
     if (running && oldthread != null && oldthread.isAlive())
@@ -286,7 +285,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   }
 
-  @Override
   public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
   {
     if (running || services == null || services.size() == 0)
@@ -360,7 +358,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     getDiscoverer().addPropertyChangeListener(new PropertyChangeListener()
     {
 
-      @Override
       public void propertyChange(PropertyChangeEvent evt)
       {
         System.out.println("Changesupport: There are now "
@@ -430,7 +427,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   public static Vector<String> getServiceUrls()
   {
     String surls = Cache.getDefault(JWS2HOSTURLS,
-            "http://www.compbio.dundee.ac.uk/jaba");
+            "http://www.compbio.dundee.ac.uk/jabaws");
     Vector<String> urls = new Vector<String>();
     try
     {
@@ -482,4 +479,28 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
             : new Vector<Jws2Instance>(services);
   }
 
+  /**
+   * test the given URL with the JabaWS test code
+   * @param foo
+   * @return
+   */
+  public static boolean testServiceUrl(URL foo)
+  {
+    try {
+      compbio.ws.client.WSTester.main(new String[] { "-h="+foo.toString()});
+    } catch (Exception e)
+    {
+      return false;
+    }
+    catch (OutOfMemoryError e)
+    {
+      return false;
+    }
+    catch (Error e)
+    {
+      return false;
+    }
+    return true;
+  }
+
 }