2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 * Jalview - A Sequence Alignment Editor and Viewer
21 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
23 * This program is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU General Public License
25 * as published by the Free Software Foundation; either version 2
26 * of the License, or (at your option) any later version.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
39 public class MuscleWSServiceLocator extends org.apache.axis.client.Service
40 implements ext.vamsas.MuscleWSService
42 // Use to get a proxy class for MuscleWS
43 private java.lang.String MuscleWS_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
45 // The WSDD service name defaults to the port name.
46 private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
48 private java.util.HashSet ports = null;
50 public MuscleWSServiceLocator()
54 public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
59 public java.lang.String getMuscleWSAddress()
61 return MuscleWS_address;
64 public java.lang.String getMuscleWSWSDDServiceName()
66 return MuscleWSWSDDServiceName;
69 public void setMuscleWSWSDDServiceName(java.lang.String name)
71 MuscleWSWSDDServiceName = name;
74 public ext.vamsas.MuscleWS getMuscleWS()
75 throws javax.xml.rpc.ServiceException
77 java.net.URL endpoint;
81 endpoint = new java.net.URL(MuscleWS_address);
82 } catch (java.net.MalformedURLException e)
84 throw new javax.xml.rpc.ServiceException(e);
87 return getMuscleWS(endpoint);
90 public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
91 throws javax.xml.rpc.ServiceException
95 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
97 _stub.setPortName(getMuscleWSWSDDServiceName());
100 } catch (org.apache.axis.AxisFault e)
106 public void setMuscleWSEndpointAddress(java.lang.String address)
108 MuscleWS_address = address;
112 * For the given interface, get the stub implementation. If this service has
113 * no port for the given interface, then ServiceException is thrown.
115 public java.rmi.Remote getPort(Class serviceEndpointInterface)
116 throws javax.xml.rpc.ServiceException
120 if (ext.vamsas.MuscleWS.class
121 .isAssignableFrom(serviceEndpointInterface))
123 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
124 new java.net.URL(MuscleWS_address), this);
125 _stub.setPortName(getMuscleWSWSDDServiceName());
129 } catch (java.lang.Throwable t)
131 throw new javax.xml.rpc.ServiceException(t);
134 throw new javax.xml.rpc.ServiceException(
135 "There is no stub implementation for the interface: "
136 + ((serviceEndpointInterface == null) ? "null"
137 : serviceEndpointInterface.getName()));
141 * For the given interface, get the stub implementation. If this service has
142 * no port for the given interface, then ServiceException is thrown.
144 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
145 Class serviceEndpointInterface)
146 throws javax.xml.rpc.ServiceException
148 if (portName == null)
150 return getPort(serviceEndpointInterface);
153 java.lang.String inputPortName = portName.getLocalPart();
155 if ("MuscleWS".equals(inputPortName))
157 return getMuscleWS();
161 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
162 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
168 public javax.xml.namespace.QName getServiceName()
170 return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
173 public java.util.Iterator getPorts()
177 ports = new java.util.HashSet();
178 ports.add(new javax.xml.namespace.QName("vamsas", "MuscleWS"));
181 return ports.iterator();
185 * Set the endpoint address for the specified port name.
187 public void setEndpointAddress(java.lang.String portName,
188 java.lang.String address) throws javax.xml.rpc.ServiceException
190 if ("MuscleWS".equals(portName))
192 setMuscleWSEndpointAddress(address);
195 { // Unknown Port Name
196 throw new javax.xml.rpc.ServiceException(
197 " Cannot set Endpoint Address for Unknown Port" + portName);
202 * Set the endpoint address for the specified port name.
204 public void setEndpointAddress(javax.xml.namespace.QName portName,
205 java.lang.String address) throws javax.xml.rpc.ServiceException
207 setEndpointAddress(portName.getLocalPart(), address);