JService.java

00001 
00025 package org.objectweb.jonas.ws.axis;
00026 
00027 import java.io.InputStream;
00028 import java.net.URL;
00029 import java.rmi.Remote;
00030 import java.util.Hashtable;
00031 import java.util.Map;
00032 import java.util.Properties;
00033 
00034 import javax.xml.namespace.QName;
00035 import javax.xml.rpc.Call;
00036 import javax.xml.rpc.ServiceException;
00037 
00038 import org.apache.axis.EngineConfiguration;
00039 import org.apache.axis.client.Service;
00040 import org.apache.axis.wsdl.gen.Parser;
00041 
00047 public class JService extends Service {
00048 
00053     private Map classname2wsdlPort = null;
00054 
00058     private Hashtable mapCallProperties = new Hashtable();
00059 
00063     private Hashtable mapStubProperties = new Hashtable();
00064 
00068     public JService() {
00069         super();
00070     }
00071 
00075     public JService(QName serviceName) {
00076         super(serviceName);
00077     }
00078 
00082     public JService(EngineConfiguration config) {
00083         super(config);
00084     }
00085 
00090     public JService(URL wsdlDoc, QName serviceName) throws ServiceException {
00091         super(wsdlDoc, serviceName);
00092     }
00093 
00098     public JService(Parser parser, QName serviceName) throws ServiceException {
00099         super(parser, serviceName);
00100     }
00101 
00106     public JService(String wsdlLocation, QName serviceName) throws ServiceException {
00107         super(wsdlLocation, serviceName);
00108     }
00109 
00114     public JService(InputStream wsdlInputStream, QName serviceName) throws ServiceException {
00115         super(wsdlInputStream, serviceName);
00116     }
00117 
00121     public Remote getPort(Class proxyInterface) throws ServiceException {
00122         if (this.classname2wsdlPort != null) {
00123             QName portname = (QName) this.classname2wsdlPort.get(proxyInterface.getName());
00124             if (portname != null) {
00125                 return getPort(portname, proxyInterface);
00126             } else {
00127                 return super.getPort(proxyInterface);
00128             }
00129         }
00130         return super.getPort(proxyInterface);
00131     }
00132 
00136     public Call createCall() throws ServiceException {
00137 
00138         return new JCall(this);
00139     }
00140 
00145     public void assignSEIClassnameToWSDLPort(Map map) {
00146         this.classname2wsdlPort = map;
00147     }
00148 
00153     public void assignCallProperties(String name, Properties callProperties) {
00154         this.mapCallProperties.put(name, callProperties);
00155     }
00156 
00161     public void assignStubProperties(String name, Properties stubProperties) {
00162         this.mapStubProperties.put(name, stubProperties);
00163     }
00164 
00169     public Properties getCallProperties(String name) {
00170         Properties props = null;
00171         if (mapCallProperties.containsKey(name)) {
00172             props = (Properties) mapCallProperties.get(name);
00173         }
00174         return props;
00175     }
00176 
00181     public Properties getStubProperties(String name) {
00182         Properties props = null;
00183         if (mapStubProperties.containsKey(name)) {
00184             props = (Properties) mapStubProperties.get(name);
00185         }
00186         return props;
00187     }
00188 
00189 }

Generated on Tue Feb 15 15:05:35 2005 for JOnAS by  doxygen 1.3.9.1