2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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 import jalview.util.MessageManager;
25 public class JpredServiceLocator extends org.apache.axis.client.Service
26 implements ext.vamsas.JpredService
29 public JpredServiceLocator()
33 public JpredServiceLocator(org.apache.axis.EngineConfiguration config)
38 // Use to get a proxy class for jpred
39 private java.lang.String jpred_address = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
41 public java.lang.String getjpredAddress()
46 // The WSDD service name defaults to the port name.
47 private java.lang.String jpredWSDDServiceName = "jpred";
49 public java.lang.String getjpredWSDDServiceName()
51 return jpredWSDDServiceName;
54 public void setjpredWSDDServiceName(java.lang.String name)
56 jpredWSDDServiceName = name;
59 public ext.vamsas.Jpred getjpred() throws javax.xml.rpc.ServiceException
61 java.net.URL endpoint;
64 endpoint = new java.net.URL(jpred_address);
65 } catch (java.net.MalformedURLException e)
67 throw new javax.xml.rpc.ServiceException(e);
69 return getjpred(endpoint);
72 public ext.vamsas.Jpred getjpred(java.net.URL portAddress)
73 throws javax.xml.rpc.ServiceException
77 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
79 _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. If this service has
94 * no port for the given interface, then ServiceException is thrown.
96 public java.rmi.Remote getPort(Class serviceEndpointInterface)
97 throws javax.xml.rpc.ServiceException
101 if (ext.vamsas.Jpred.class.isAssignableFrom(serviceEndpointInterface))
103 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(
104 new java.net.URL(jpred_address), this);
105 _stub.setPortName(getjpredWSDDServiceName());
108 } catch (java.lang.Throwable t)
110 throw new javax.xml.rpc.ServiceException(t);
112 throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage(
113 "exception.no_stub_implementation_for_interface",
114 new String[] { (serviceEndpointInterface == null ? "null"
115 : serviceEndpointInterface.getName()) }));
119 * For the given interface, get the stub implementation. If this service has
120 * no port for the given interface, then ServiceException is thrown.
122 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
123 Class serviceEndpointInterface)
124 throws javax.xml.rpc.ServiceException
126 if (portName == null)
128 return getPort(serviceEndpointInterface);
130 java.lang.String inputPortName = portName.getLocalPart();
131 if ("jpred".equals(inputPortName))
137 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
138 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
143 public javax.xml.namespace.QName getServiceName()
145 return new javax.xml.namespace.QName("vamsas", "jpredService");
148 private java.util.HashSet ports = null;
150 public java.util.Iterator getPorts()
154 ports = new java.util.HashSet();
155 ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
157 return ports.iterator();
161 * Set the endpoint address for the specified port name.
163 public void setEndpointAddress(java.lang.String portName,
164 java.lang.String address) throws javax.xml.rpc.ServiceException
166 if ("jpred".equals(portName))
168 setjpredEndpointAddress(address);
171 { // Unknown Port Name
172 throw new javax.xml.rpc.ServiceException(
173 MessageManager.formatMessage(
174 "exception.cannot_set_endpoint_address_unknown_port",
175 new String[] { portName }));
180 * Set the endpoint address for the specified port name.
182 public void setEndpointAddress(javax.xml.namespace.QName portName,
183 java.lang.String address) throws javax.xml.rpc.ServiceException
185 setEndpointAddress(portName.getLocalPart(), address);