X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FJws2Discoverer.java;h=910b7497cc17aa8ee43a819e94775919b748a9a6;hb=68c26e8852772be21fdb5b091fa9083d8cdb6eec;hp=32e9ad50d703621cbea75ae662d4b3030542f689;hpb=3e462b3323ccf43864d73d6cdfccd0fd84301a30;p=jalview.git
diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java
index 32e9ad5..910b749 100644
--- a/src/jalview/ws/jws2/Jws2Discoverer.java
+++ b/src/jalview/ws/jws2/Jws2Discoverer.java
@@ -1,19 +1,22 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws.jws2;
@@ -21,6 +24,7 @@ import jalview.bin.Cache;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
+import jalview.util.MessageManager;
import jalview.ws.WSMenuEntryProviderI;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ParamDatastoreI;
@@ -38,6 +42,7 @@ import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -105,6 +110,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
public void run()
{
+
if (running && oldthread != null && oldthread.isAlive())
{
if (!aborted)
@@ -126,8 +132,16 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
Cache.log.debug("Old discovery thread has finished.");
}
running = true;
-
-
+
+ // first set up exclusion list if needed
+ final Set ignoredServices = new HashSet();
+ for (String ignored : jalview.bin.Cache.getDefault(
+ "IGNORED_JABAWS_SERVICETYPES", "")
+ .split("\\|"))
+ {
+ ignoredServices.add(ignored);
+ }
+
changeSupport.firePropertyChange("services", services, new Vector());
oldthread = Thread.currentThread();
try
@@ -171,7 +185,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
// for all possible services
for (Services sv : squery.JABAWS2SERVERS)
{
- svctypes.add(sv.toString());
+ if (!ignoredServices.contains(sv.toString()))
+ {
+ svctypes.add(sv.toString());
+ }
}
}
@@ -191,8 +208,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
;
for (JabaWsServerQuery squery : qrys)
{
- if (squery.isRunning()){
- finished=false;
+ if (squery.isRunning())
+ {
+ finished = false;
}
}
if (aborted)
@@ -226,7 +244,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
services = new Vector();
for (Jws2Instance svc : svcs)
{
- services.add(svc);
+ if (!ignoredServices.contains(svc.serviceType))
+ {
+ services.add(svc);
+ }
}
}
}
@@ -367,14 +388,14 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
}
});
hitm.setToolTipText(JvSwingUtils
- .wrapTooltip("Opens the JABAWS server's homepage in web browser"));
+ .wrapTooltip(false, MessageManager.getString("label.open_jabaws_web_page ")));
service.attachWSMenuEntry(atpoint, alignFrame);
if (alternates.containsKey(service.serviceType))
{
- atpoint.add(hitm = new JMenu("Switch server"));
+ atpoint.add(hitm = new JMenu(MessageManager.getString("label.switch_server")));
hitm.setToolTipText(JvSwingUtils
- .wrapTooltip("Choose a server for running this service"));
+ .wrapTooltip(false, MessageManager.getString("label.choose_jabaws_server")));
for (final Jws2Instance sv : alternates.get(service.serviceType))
{
JMenuItem itm;
@@ -463,7 +484,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
atpoint = JvSwingUtils.findOrCreateMenu(atpoint, host);
if (atpoint.getToolTipText() == null)
{
- atpoint.setToolTipText("Services at " + host);
+ atpoint.setToolTipText(MessageManager.formatMessage("label.services_at", new String[]{host}));
}
}
if (bytype)
@@ -508,7 +529,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
}
});
hitm.setToolTipText(JvSwingUtils
- .wrapTooltip("Opens the JABAWS server's homepage in web browser"));
+ .wrapTooltip(true, MessageManager.getString("label.open_jabaws_web_page")));
lasthostFor.put(service.action, host);
}
hostLabels.add(host + service.serviceType