View Javadoc

1   /**
2    * TabSvcLocator.java
3    *
4    * This file was auto-generated from WSDL
5    * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
6    */
7   
8   package org.sirius.server.win32lib.controls.tab;
9   
10  public class TabSvcLocator extends org.apache.axis.client.Service implements
11          org.sirius.server.win32lib.controls.tab.TabSvc {
12  
13      // Use to get a proxy class for TabSvcPort
14      private java.lang.String  TabSvcPort_address        = "http://localhost:31313/win32lib/tabsvc";
15  
16      // The WSDD service name defaults to the port name.
17      private java.lang.String  TabSvcPortWSDDServiceName = "TabSvcPort";
18  
19      private java.util.HashSet ports                     = null;
20  
21      public TabSvcLocator() {
22      }
23  
24      public TabSvcLocator(final java.lang.String wsdlLoc,
25              final javax.xml.namespace.QName sName)
26              throws javax.xml.rpc.ServiceException {
27          super(wsdlLoc, sName);
28      }
29  
30      public TabSvcLocator(final org.apache.axis.EngineConfiguration config) {
31          super(config);
32      }
33  
34      /**
35       * For the given interface, get the stub implementation. If this service has
36       * no port for the given interface, then ServiceException is thrown.
37       */
38      @Override
39      public java.rmi.Remote getPort(final Class serviceEndpointInterface)
40              throws javax.xml.rpc.ServiceException {
41          try {
42              if (org.sirius.server.win32lib.controls.tab.ITabContract.class
43                      .isAssignableFrom(serviceEndpointInterface)) {
44                  org.sirius.server.win32lib.controls.tab.TabSvcPortStub _stub = new org.sirius.server.win32lib.controls.tab.TabSvcPortStub(
45                          new java.net.URL(TabSvcPort_address), this);
46                  _stub.setPortName(getTabSvcPortWSDDServiceName());
47                  return _stub;
48              }
49          } catch (java.lang.Throwable t) {
50              throw new javax.xml.rpc.ServiceException(t);
51          }
52          throw new javax.xml.rpc.ServiceException(
53                  "There is no stub implementation for the interface:  "
54                          + (serviceEndpointInterface == null ? "null"
55                                  : serviceEndpointInterface.getName()));
56      }
57  
58      /**
59       * For the given interface, get the stub implementation. If this service has
60       * no port for the given interface, then ServiceException is thrown.
61       */
62      @Override
63      public java.rmi.Remote getPort(final javax.xml.namespace.QName portName,
64              final Class serviceEndpointInterface)
65              throws javax.xml.rpc.ServiceException {
66          if (portName == null) {
67              return getPort(serviceEndpointInterface);
68          }
69          java.lang.String inputPortName = portName.getLocalPart();
70          if ("TabSvcPort".equals(inputPortName)) {
71              return getTabSvcPort();
72          } else {
73              java.rmi.Remote _stub = getPort(serviceEndpointInterface);
74              ((org.apache.axis.client.Stub) _stub).setPortName(portName);
75              return _stub;
76          }
77      }
78  
79      @Override
80      public java.util.Iterator getPorts() {
81          if (ports == null) {
82              ports = new java.util.HashSet();
83              ports.add(new javax.xml.namespace.QName(
84                      "http://tab.controls.win32lib.server.sirius.org/",
85                      "TabSvcPort"));
86          }
87          return ports.iterator();
88      }
89  
90      @Override
91      public javax.xml.namespace.QName getServiceName() {
92          return new javax.xml.namespace.QName(
93                  "http://tab.controls.win32lib.server.sirius.org/", "TabSvc");
94      }
95  
96      @Override
97      public org.sirius.server.win32lib.controls.tab.ITabContract getTabSvcPort()
98              throws javax.xml.rpc.ServiceException {
99          java.net.URL endpoint;
100         try {
101             endpoint = new java.net.URL(TabSvcPort_address);
102         } catch (java.net.MalformedURLException e) {
103             throw new javax.xml.rpc.ServiceException(e);
104         }
105         return getTabSvcPort(endpoint);
106     }
107 
108     @Override
109     public org.sirius.server.win32lib.controls.tab.ITabContract getTabSvcPort(
110             final java.net.URL portAddress)
111             throws javax.xml.rpc.ServiceException {
112         try {
113             org.sirius.server.win32lib.controls.tab.TabSvcPortStub _stub = new org.sirius.server.win32lib.controls.tab.TabSvcPortStub(
114                     portAddress, this);
115             _stub.setPortName(getTabSvcPortWSDDServiceName());
116             return _stub;
117         } catch (org.apache.axis.AxisFault e) {
118             return null;
119         }
120     }
121 
122     @Override
123     public java.lang.String getTabSvcPortAddress() {
124         return TabSvcPort_address;
125     }
126 
127     public java.lang.String getTabSvcPortWSDDServiceName() {
128         return TabSvcPortWSDDServiceName;
129     }
130 
131     /**
132      * Set the endpoint address for the specified port name.
133      */
134     public void setEndpointAddress(final java.lang.String portName,
135             final java.lang.String address)
136             throws javax.xml.rpc.ServiceException {
137 
138         if ("TabSvcPort".equals(portName)) {
139             setTabSvcPortEndpointAddress(address);
140         } else { // Unknown Port Name
141             throw new javax.xml.rpc.ServiceException(
142                     " Cannot set Endpoint Address for Unknown Port" + portName);
143         }
144     }
145 
146     /**
147      * Set the endpoint address for the specified port name.
148      */
149     public void setEndpointAddress(final javax.xml.namespace.QName portName,
150             final java.lang.String address)
151             throws javax.xml.rpc.ServiceException {
152         setEndpointAddress(portName.getLocalPart(), address);
153     }
154 
155     public void setTabSvcPortEndpointAddress(final java.lang.String address) {
156         TabSvcPort_address = address;
157     }
158 
159     public void setTabSvcPortWSDDServiceName(final java.lang.String name) {
160         TabSvcPortWSDDServiceName = name;
161     }
162 
163 }