From 00be6641b2b32a29507cb4afbd966e82cfcf5b98 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sat, 5 Oct 2013 13:59:40 +0100 Subject: [PATCH] JAL-1379 JAL-1378 exclusion list property to ignore services not fully integrated with Jalview --- src/jalview/ws/jws2/Jws2Discoverer.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java index 32e9ad5..8f56e2f 100644 --- a/src/jalview/ws/jws2/Jws2Discoverer.java +++ b/src/jalview/ws/jws2/Jws2Discoverer.java @@ -38,6 +38,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 +106,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI public void run() { + if (running && oldthread != null && oldthread.isAlive()) { if (!aborted) @@ -127,6 +129,13 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI } running = true; + // first set up exclusion list if needed + final Set ignoredServices = new HashSet(); + for (String ignored:jalview.bin.Cache.getDefault("IGNORED_JABAWS_SERVICETYPES", Services.JpredWS.toString()).split("\\|")) + { + ignoredServices.add(ignored); + } + changeSupport.firePropertyChange("services", services, new Vector()); oldthread = Thread.currentThread(); @@ -171,7 +180,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()); + } } } @@ -226,7 +238,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); + } } } } -- 1.7.10.2