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
21 public class JpredServiceLocator extends org.apache.axis.client.Service
22 implements ext.vamsas.JpredService
25 public JpredServiceLocator()
29 public JpredServiceLocator(org.apache.axis.EngineConfiguration config)
34 // Use to get a proxy class for jpred
35 private java.lang.String jpred_address = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
37 public java.lang.String getjpredAddress()
42 // The WSDD service name defaults to the port name.
43 private java.lang.String jpredWSDDServiceName = "jpred";
45 public java.lang.String getjpredWSDDServiceName()
47 return jpredWSDDServiceName;
50 public void setjpredWSDDServiceName(java.lang.String name)
52 jpredWSDDServiceName = name;
55 public ext.vamsas.Jpred getjpred() throws javax.xml.rpc.ServiceException
57 java.net.URL endpoint;
60 endpoint = new java.net.URL(jpred_address);
61 } catch (java.net.MalformedURLException e)
63 throw new javax.xml.rpc.ServiceException(e);
65 return getjpred(endpoint);
68 public ext.vamsas.Jpred getjpred(java.net.URL portAddress)
69 throws javax.xml.rpc.ServiceException
73 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
75 _stub.setPortName(getjpredWSDDServiceName());
77 } catch (org.apache.axis.AxisFault e)
83 public void setjpredEndpointAddress(java.lang.String address)
85 jpred_address = address;
89 * For the given interface, get the stub implementation. If this service has
90 * no port for the given interface, then ServiceException is thrown.
92 public java.rmi.Remote getPort(Class serviceEndpointInterface)
93 throws javax.xml.rpc.ServiceException
97 if (ext.vamsas.Jpred.class.isAssignableFrom(serviceEndpointInterface))
99 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
100 new java.net.URL(jpred_address), this);
101 _stub.setPortName(getjpredWSDDServiceName());
104 } catch (java.lang.Throwable t)
106 throw new javax.xml.rpc.ServiceException(t);
108 throw new javax.xml.rpc.ServiceException(
109 "There is no stub implementation for the interface: "
110 + (serviceEndpointInterface == null ? "null"
111 : serviceEndpointInterface.getName()));
115 * For the given interface, get the stub implementation. If this service has
116 * no port for the given interface, then ServiceException is thrown.
118 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
119 Class serviceEndpointInterface)
120 throws javax.xml.rpc.ServiceException
122 if (portName == null)
124 return getPort(serviceEndpointInterface);
126 java.lang.String inputPortName = portName.getLocalPart();
127 if ("jpred".equals(inputPortName))
133 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
134 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
139 public javax.xml.namespace.QName getServiceName()
141 return new javax.xml.namespace.QName("vamsas", "jpredService");
144 private java.util.HashSet ports = null;
146 public java.util.Iterator getPorts()
150 ports = new java.util.HashSet();
151 ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
153 return ports.iterator();
157 * Set the endpoint address for the specified port name.
159 public void setEndpointAddress(java.lang.String portName,
160 java.lang.String address) throws javax.xml.rpc.ServiceException
162 if ("jpred".equals(portName))
164 setjpredEndpointAddress(address);
167 { // Unknown Port Name
168 throw new javax.xml.rpc.ServiceException(
169 " Cannot set Endpoint Address for Unknown Port" + portName);
174 * Set the endpoint address for the specified port name.
176 public void setEndpointAddress(javax.xml.namespace.QName portName,
177 java.lang.String address) throws javax.xml.rpc.ServiceException
179 setEndpointAddress(portName.getLocalPart(), address);