2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, 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/>.
19 * Jalview - A Sequence Alignment Editor and Viewer
20 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version 2
25 * of the License, or (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
38 public class MuscleWSServiceLocator extends org.apache.axis.client.Service
39 implements ext.vamsas.MuscleWSService
41 // Use to get a proxy class for MuscleWS
42 private java.lang.String MuscleWS_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
44 // The WSDD service name defaults to the port name.
45 private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
47 private java.util.HashSet ports = null;
49 public MuscleWSServiceLocator()
53 public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
58 public java.lang.String getMuscleWSAddress()
60 return MuscleWS_address;
63 public java.lang.String getMuscleWSWSDDServiceName()
65 return MuscleWSWSDDServiceName;
68 public void setMuscleWSWSDDServiceName(java.lang.String name)
70 MuscleWSWSDDServiceName = name;
73 public ext.vamsas.MuscleWS getMuscleWS()
74 throws javax.xml.rpc.ServiceException
76 java.net.URL endpoint;
80 endpoint = new java.net.URL(MuscleWS_address);
81 } catch (java.net.MalformedURLException e)
83 throw new javax.xml.rpc.ServiceException(e);
86 return getMuscleWS(endpoint);
89 public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
90 throws javax.xml.rpc.ServiceException
94 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
96 _stub.setPortName(getMuscleWSWSDDServiceName());
99 } catch (org.apache.axis.AxisFault e)
105 public void setMuscleWSEndpointAddress(java.lang.String address)
107 MuscleWS_address = address;
111 * For the given interface, get the stub implementation. If this service has
112 * no port for the given interface, then ServiceException is thrown.
114 public java.rmi.Remote getPort(Class serviceEndpointInterface)
115 throws javax.xml.rpc.ServiceException
119 if (ext.vamsas.MuscleWS.class
120 .isAssignableFrom(serviceEndpointInterface))
122 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
123 new java.net.URL(MuscleWS_address), this);
124 _stub.setPortName(getMuscleWSWSDDServiceName());
128 } catch (java.lang.Throwable t)
130 throw new javax.xml.rpc.ServiceException(t);
133 throw new javax.xml.rpc.ServiceException(
134 "There is no stub implementation for the interface: "
135 + ((serviceEndpointInterface == null) ? "null"
136 : serviceEndpointInterface.getName()));
140 * For the given interface, get the stub implementation. If this service has
141 * no port for the given interface, then ServiceException is thrown.
143 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
144 Class serviceEndpointInterface)
145 throws javax.xml.rpc.ServiceException
147 if (portName == null)
149 return getPort(serviceEndpointInterface);
152 java.lang.String inputPortName = portName.getLocalPart();
154 if ("MuscleWS".equals(inputPortName))
156 return getMuscleWS();
160 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
161 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
167 public javax.xml.namespace.QName getServiceName()
169 return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
172 public java.util.Iterator getPorts()
176 ports = new java.util.HashSet();
177 ports.add(new javax.xml.namespace.QName("vamsas", "MuscleWS"));
180 return ports.iterator();
184 * Set the endpoint address for the specified port name.
186 public void setEndpointAddress(java.lang.String portName,
187 java.lang.String address) throws javax.xml.rpc.ServiceException
189 if ("MuscleWS".equals(portName))
191 setMuscleWSEndpointAddress(address);
194 { // Unknown Port Name
195 throw new javax.xml.rpc.ServiceException(
196 " Cannot set Endpoint Address for Unknown Port" + portName);
201 * Set the endpoint address for the specified port name.
203 public void setEndpointAddress(javax.xml.namespace.QName portName,
204 java.lang.String address) throws javax.xml.rpc.ServiceException
206 setEndpointAddress(portName.getLocalPart(), address);