2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 public class JpredServiceLocator extends org.apache.axis.client.Service
24 implements ext.vamsas.JpredService
27 public JpredServiceLocator()
31 public JpredServiceLocator(org.apache.axis.EngineConfiguration config)
36 // Use to get a proxy class for jpred
37 private java.lang.String jpred_address = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
39 public java.lang.String getjpredAddress()
44 // The WSDD service name defaults to the port name.
45 private java.lang.String jpredWSDDServiceName = "jpred";
47 public java.lang.String getjpredWSDDServiceName()
49 return jpredWSDDServiceName;
52 public void setjpredWSDDServiceName(java.lang.String name)
54 jpredWSDDServiceName = name;
57 public ext.vamsas.Jpred getjpred() throws javax.xml.rpc.ServiceException
59 java.net.URL endpoint;
62 endpoint = new java.net.URL(jpred_address);
63 } catch (java.net.MalformedURLException e)
65 throw new javax.xml.rpc.ServiceException(e);
67 return getjpred(endpoint);
70 public ext.vamsas.Jpred getjpred(java.net.URL portAddress)
71 throws javax.xml.rpc.ServiceException
75 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
77 _stub.setPortName(getjpredWSDDServiceName());
79 } catch (org.apache.axis.AxisFault e)
85 public void setjpredEndpointAddress(java.lang.String address)
87 jpred_address = address;
91 * For the given interface, get the stub implementation. If this service has
92 * no port for the given interface, then ServiceException is thrown.
94 public java.rmi.Remote getPort(Class serviceEndpointInterface)
95 throws javax.xml.rpc.ServiceException
99 if (ext.vamsas.Jpred.class.isAssignableFrom(serviceEndpointInterface))
101 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
102 new java.net.URL(jpred_address), this);
103 _stub.setPortName(getjpredWSDDServiceName());
106 } catch (java.lang.Throwable t)
108 throw new javax.xml.rpc.ServiceException(t);
110 throw new javax.xml.rpc.ServiceException(
111 "There is no stub implementation for the interface: "
112 + (serviceEndpointInterface == null ? "null"
113 : serviceEndpointInterface.getName()));
117 * For the given interface, get the stub implementation. If this service has
118 * no port for the given interface, then ServiceException is thrown.
120 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
121 Class serviceEndpointInterface)
122 throws javax.xml.rpc.ServiceException
124 if (portName == null)
126 return getPort(serviceEndpointInterface);
128 java.lang.String inputPortName = portName.getLocalPart();
129 if ("jpred".equals(inputPortName))
135 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
136 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
141 public javax.xml.namespace.QName getServiceName()
143 return new javax.xml.namespace.QName("vamsas", "jpredService");
146 private java.util.HashSet ports = null;
148 public java.util.Iterator getPorts()
152 ports = new java.util.HashSet();
153 ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
155 return ports.iterator();
159 * Set the endpoint address for the specified port name.
161 public void setEndpointAddress(java.lang.String portName,
162 java.lang.String address) throws javax.xml.rpc.ServiceException
164 if ("jpred".equals(portName))
166 setjpredEndpointAddress(address);
169 { // Unknown Port Name
170 throw new javax.xml.rpc.ServiceException(
171 " Cannot set Endpoint Address for Unknown Port" + portName);
176 * Set the endpoint address for the specified port name.
178 public void setEndpointAddress(javax.xml.namespace.QName portName,
179 java.lang.String address) throws javax.xml.rpc.ServiceException
181 setEndpointAddress(portName.getLocalPart(), address);