2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 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
40 extends org.apache.axis.client.Service implements ext.vamsas.
43 // Use to get a proxy class for MuscleWS
44 private java.lang.String MuscleWS_address =
45 "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
47 // The WSDD service name defaults to the port name.
48 private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
49 private java.util.HashSet ports = null;
51 public MuscleWSServiceLocator()
55 public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
60 public java.lang.String getMuscleWSAddress()
62 return MuscleWS_address;
65 public java.lang.String getMuscleWSWSDDServiceName()
67 return MuscleWSWSDDServiceName;
70 public void setMuscleWSWSDDServiceName(java.lang.String name)
72 MuscleWSWSDDServiceName = name;
75 public ext.vamsas.MuscleWS getMuscleWS()
76 throws javax.xml.rpc.ServiceException
78 java.net.URL endpoint;
82 endpoint = new java.net.URL(MuscleWS_address);
84 catch (java.net.MalformedURLException e)
86 throw new javax.xml.rpc.ServiceException(e);
89 return getMuscleWS(endpoint);
92 public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
93 throws javax.xml.rpc.ServiceException
97 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.
98 MuscleWSSoapBindingStub(portAddress,
100 _stub.setPortName(getMuscleWSWSDDServiceName());
104 catch (org.apache.axis.AxisFault e)
110 public void setMuscleWSEndpointAddress(java.lang.String address)
112 MuscleWS_address = address;
116 * For the given interface, get the stub implementation.
117 * If this service has no port for the given interface,
118 * then ServiceException is thrown.
120 public java.rmi.Remote getPort(Class serviceEndpointInterface)
121 throws javax.xml.rpc.ServiceException
125 if (ext.vamsas.MuscleWS.class.isAssignableFrom(
126 serviceEndpointInterface))
128 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.
129 MuscleWSSoapBindingStub(new java.net.URL(
130 MuscleWS_address), this);
131 _stub.setPortName(getMuscleWSWSDDServiceName());
136 catch (java.lang.Throwable t)
138 throw new javax.xml.rpc.ServiceException(t);
141 throw new javax.xml.rpc.ServiceException(
142 "There is no stub implementation for the interface: " +
143 ( (serviceEndpointInterface == null) ? "null"
144 : serviceEndpointInterface.getName()));
148 * For the given interface, get the stub implementation.
149 * If this service has no port for the given interface,
150 * then ServiceException is thrown.
152 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
153 Class serviceEndpointInterface)
154 throws javax.xml.rpc.ServiceException
156 if (portName == null)
158 return getPort(serviceEndpointInterface);
161 java.lang.String inputPortName = portName.getLocalPart();
163 if ("MuscleWS".equals(inputPortName))
165 return getMuscleWS();
169 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
170 ( (org.apache.axis.client.Stub) _stub).setPortName(portName);
176 public javax.xml.namespace.QName getServiceName()
178 return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
181 public java.util.Iterator getPorts()
185 ports = new java.util.HashSet();
186 ports.add(new javax.xml.namespace.QName("vamsas", "MuscleWS"));
189 return ports.iterator();
193 * Set the endpoint address for the specified port name.
195 public void setEndpointAddress(java.lang.String portName,
196 java.lang.String address)
197 throws javax.xml.rpc.ServiceException
199 if ("MuscleWS".equals(portName))
201 setMuscleWSEndpointAddress(address);
204 { // Unknown Port Name
205 throw new javax.xml.rpc.ServiceException(
206 " Cannot set Endpoint Address for Unknown Port" + portName);
211 * Set the endpoint address for the specified port name.
213 public void setEndpointAddress(javax.xml.namespace.QName portName,
214 java.lang.String address)
215 throws javax.xml.rpc.ServiceException
217 setEndpointAddress(portName.getLocalPart(), address);