2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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/>.
20 public class JpredServiceLocator extends org.apache.axis.client.Service
21 implements ext.vamsas.JpredService
24 public JpredServiceLocator()
28 public JpredServiceLocator(org.apache.axis.EngineConfiguration config)
33 // Use to get a proxy class for jpred
34 private java.lang.String jpred_address = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
36 public java.lang.String getjpredAddress()
41 // The WSDD service name defaults to the port name.
42 private java.lang.String jpredWSDDServiceName = "jpred";
44 public java.lang.String getjpredWSDDServiceName()
46 return jpredWSDDServiceName;
49 public void setjpredWSDDServiceName(java.lang.String name)
51 jpredWSDDServiceName = name;
54 public ext.vamsas.Jpred getjpred() throws javax.xml.rpc.ServiceException
56 java.net.URL endpoint;
59 endpoint = new java.net.URL(jpred_address);
60 } catch (java.net.MalformedURLException e)
62 throw new javax.xml.rpc.ServiceException(e);
64 return getjpred(endpoint);
67 public ext.vamsas.Jpred getjpred(java.net.URL portAddress)
68 throws javax.xml.rpc.ServiceException
72 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
74 _stub.setPortName(getjpredWSDDServiceName());
76 } catch (org.apache.axis.AxisFault e)
82 public void setjpredEndpointAddress(java.lang.String address)
84 jpred_address = address;
88 * For the given interface, get the stub implementation. If this service has
89 * no port for the given interface, then ServiceException is thrown.
91 public java.rmi.Remote getPort(Class serviceEndpointInterface)
92 throws javax.xml.rpc.ServiceException
96 if (ext.vamsas.Jpred.class.isAssignableFrom(serviceEndpointInterface))
98 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
99 new java.net.URL(jpred_address), this);
100 _stub.setPortName(getjpredWSDDServiceName());
103 } catch (java.lang.Throwable t)
105 throw new javax.xml.rpc.ServiceException(t);
107 throw new javax.xml.rpc.ServiceException(
108 "There is no stub implementation for the interface: "
109 + (serviceEndpointInterface == null ? "null"
110 : serviceEndpointInterface.getName()));
114 * For the given interface, get the stub implementation. If this service has
115 * no port for the given interface, then ServiceException is thrown.
117 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
118 Class serviceEndpointInterface)
119 throws javax.xml.rpc.ServiceException
121 if (portName == null)
123 return getPort(serviceEndpointInterface);
125 java.lang.String inputPortName = portName.getLocalPart();
126 if ("jpred".equals(inputPortName))
132 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
133 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
138 public javax.xml.namespace.QName getServiceName()
140 return new javax.xml.namespace.QName("vamsas", "jpredService");
143 private java.util.HashSet ports = null;
145 public java.util.Iterator getPorts()
149 ports = new java.util.HashSet();
150 ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
152 return ports.iterator();
156 * Set the endpoint address for the specified port name.
158 public void setEndpointAddress(java.lang.String portName,
159 java.lang.String address) throws javax.xml.rpc.ServiceException
161 if ("jpred".equals(portName))
163 setjpredEndpointAddress(address);
166 { // Unknown Port Name
167 throw new javax.xml.rpc.ServiceException(
168 " Cannot set Endpoint Address for Unknown Port" + portName);
173 * Set the endpoint address for the specified port name.
175 public void setEndpointAddress(javax.xml.namespace.QName portName,
176 java.lang.String address) throws javax.xml.rpc.ServiceException
178 setEndpointAddress(portName.getLocalPart(), address);