X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FDiscoverer.java;h=8aea33d920088b5acf817c8214555da1529b1b3b;hb=3d1147ffae5fbc5bdb7c80caa9655df656b8e67b;hp=02028b41acb25e5276f30cdee71f92537f1ace7a;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/ws/Discoverer.java b/src/jalview/ws/Discoverer.java index 02028b4..8aea33d 100755 --- a/src/jalview/ws/Discoverer.java +++ b/src/jalview/ws/Discoverer.java @@ -380,4 +380,41 @@ public class Discoverer }; discoverThread.start(); } + /** + * binding service abstract name to handler class + */ + private static Hashtable serviceClientBindings; + public static WSClient getServiceClient(ServiceHandle sh) + { + if (serviceClientBindings==null) + { + // get a list from Config or create below + serviceClientBindings = new Hashtable(); + serviceClientBindings.put("MsaWS",new MsaWSClient()); + serviceClientBindings.put("SecStrPred",new JPredClient()); + serviceClientBindings.put("SeqSearch",new SeqSearchWSClient()); + } + WSClient instance = (WSClient) serviceClientBindings.get(sh.getAbstractName()); + if (instance==null) + { + System.err.println("WARNING - POSSIBLE IMPLEMENTATION ERROR - cannot find WSClient implementation for "+sh.getAbstractName()); + } else + { + instance.serviceHandle = sh; + } + return instance; + } + /** + * notes on discovery service + * 1. need to allow multiple discovery source urls. + * 2. user interface to add/control list of urls in preferences + * notes on wsclient discovery + * 1. need a classpath property with list of additional plugin directories + * 2. optional config to cite specific bindings between class name and Abstract service name. + * 3. precedence for automatic discovery by using getAbstractName for WSClient - user added plugins override default plugins ? + * notes on wsclient gui + * code for gui attachment now moved to wsclient implementation. Needs more abstraction but approach seems to work. + * is it possible to 'generalise' the data retrieval calls further ? current methods are very specific (gatherForMSA or gatherForSeqOrMsaSecStrPred), new methods for conservation (group or alignment), treecalc (aligned profile), seqannot (sequences selected from dataset, annotation back to dataset). + * + */ }