1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
21 package jalview.ws.jws2;
23 import jalview.bin.Cache;
25 import compbio.data.msa.MsaWS;
26 import compbio.ws.client.Jws2Client;
27 import compbio.ws.client.Services;
33 public class JabaWsServerQuery implements Runnable
36 Jws2Discoverer jws2Discoverer=null;
37 String jwsservers=null;
43 public boolean isRunning()
49 * @param quit the quit to set
51 public void setQuit(boolean quit)
56 public JabaWsServerQuery(Jws2Discoverer jws2Discoverer, String jwsservers)
58 this.jws2Discoverer = jws2Discoverer;
59 this.jwsservers=jwsservers;
63 * @see java.lang.Runnable#run()
71 if (Jws2Client.validURL(jwsservers))
73 boolean noservices=true;
75 for (Services srv : Services.values())
85 service = Jws2Client.connect(jwsservers, srv);
88 System.err.println("Jws2 Discoverer: Problem on "
89 + jwsservers + " with service " + srv + ":\n"
91 if (!(e instanceof javax.xml.ws.WebServiceException))
95 // For moment, report service as a problem.
96 jws2Discoverer.addInvalidServiceUrl(jwsservers);
102 jws2Discoverer.addService(jwsservers, srv, service);
107 jws2Discoverer.addUrlwithnoservices(jwsservers);
112 jws2Discoverer.addInvalidServiceUrl(jwsservers);
113 Cache.log.info("Ignoring invalid Jws2 service url " + jwsservers);
115 } catch (Exception e)
118 Cache.log.warn("Exception when discovering Jws2 services.", e);
119 jws2Discoverer.addInvalidServiceUrl(jwsservers);
122 Cache.log.error("Exception when discovering Jws2 services.", e);
123 jws2Discoverer.addInvalidServiceUrl(jwsservers);