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
21 public class JpredServiceLocator
22 extends org.apache.axis.client.Service 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 =
36 "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
38 public java.lang.String getjpredAddress()
43 // The WSDD service name defaults to the port name.
44 private java.lang.String jpredWSDDServiceName = "jpred";
46 public java.lang.String getjpredWSDDServiceName()
48 return jpredWSDDServiceName;
51 public void setjpredWSDDServiceName(java.lang.String name)
53 jpredWSDDServiceName = name;
56 public ext.vamsas.Jpred getjpred()
57 throws javax.xml.rpc.ServiceException
59 java.net.URL endpoint;
62 endpoint = new java.net.URL(jpred_address);
64 catch (java.net.MalformedURLException e)
66 throw new javax.xml.rpc.ServiceException(e);
68 return getjpred(endpoint);
71 public ext.vamsas.Jpred getjpred(java.net.URL portAddress)
72 throws javax.xml.rpc.ServiceException
76 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.
77 JpredSoapBindingStub(portAddress, this);
78 _stub.setPortName(getjpredWSDDServiceName());
81 catch (org.apache.axis.AxisFault e)
87 public void setjpredEndpointAddress(java.lang.String address)
89 jpred_address = address;
93 * For the given interface, get the stub implementation.
94 * If this service has no port for the given interface,
95 * then ServiceException is thrown.
97 public java.rmi.Remote getPort(Class serviceEndpointInterface)
98 throws javax.xml.rpc.ServiceException
102 if (ext.vamsas.Jpred.class.isAssignableFrom(serviceEndpointInterface))
104 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.
105 JpredSoapBindingStub(new java.net.URL(jpred_address), this);
106 _stub.setPortName(getjpredWSDDServiceName());
110 catch (java.lang.Throwable t)
112 throw new javax.xml.rpc.ServiceException(t);
114 throw new javax.xml.rpc.ServiceException(
115 "There is no stub implementation for the interface: " +
116 (serviceEndpointInterface == null ? "null" :
117 serviceEndpointInterface.getName()));
121 * For the given interface, get the stub implementation.
122 * If this service has no port for the given interface,
123 * then ServiceException is thrown.
125 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
126 Class serviceEndpointInterface)
127 throws javax.xml.rpc.ServiceException
129 if (portName == null)
131 return getPort(serviceEndpointInterface);
133 java.lang.String inputPortName = portName.getLocalPart();
134 if ("jpred".equals(inputPortName))
140 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
141 ( (org.apache.axis.client.Stub) _stub).setPortName(portName);
146 public javax.xml.namespace.QName getServiceName()
148 return new javax.xml.namespace.QName("vamsas", "jpredService");
151 private java.util.HashSet ports = null;
153 public java.util.Iterator getPorts()
157 ports = new java.util.HashSet();
158 ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
160 return ports.iterator();
164 * Set the endpoint address for the specified port name.
166 public void setEndpointAddress(java.lang.String portName,
167 java.lang.String address)
168 throws javax.xml.rpc.ServiceException
170 if ("jpred".equals(portName))
172 setjpredEndpointAddress(address);
175 { // Unknown Port Name
176 throw new javax.xml.rpc.ServiceException(
177 " Cannot set Endpoint Address for Unknown Port" + portName);
182 * Set the endpoint address for the specified port name.
184 public void setEndpointAddress(javax.xml.namespace.QName portName,
185 java.lang.String address)
186 throws javax.xml.rpc.ServiceException
188 setEndpointAddress(portName.getLocalPart(), address);