KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > ws > axis > JCall


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  */

21 package org.objectweb.jonas.ws.axis;
22
23 import java.util.Enumeration JavaDoc;
24 import java.util.Properties JavaDoc;
25
26 import javax.xml.namespace.QName JavaDoc;
27 import javax.xml.rpc.Stub JavaDoc;
28
29 import org.apache.axis.client.Call;
30
31 /**
32  * JCall is the JOnAS J2EE layer on top of axis Call implementation.
33  * It is used to assign Call properties.
34  * @author Jerome Camilleri
35  */

36 public class JCall extends Call {
37
38     /**
39      * @see org.apache.axis.client.Call#Call(Service)
40      */

41     public JCall(JService service) {
42         super(service);
43     }
44
45     /**
46      * Sets the port name of this Call object. This call will not set
47      * any additional fields, nor will it do any checking to verify that
48      * this port name is actually defined in the WSDL - for now anyway.
49      *
50      * @param portName Fully qualified name of the port
51      */

52     public void setPortName(QName JavaDoc portName) {
53         super.setPortName(portName);
54         JService service = (JService) this.getService();
55         Properties JavaDoc propCall = service.getCallProperties(portName.getLocalPart());
56         if (propCall != null) {
57             for (Enumeration JavaDoc e = propCall.propertyNames(); e.hasMoreElements();) {
58                 String JavaDoc name = (String JavaDoc) e.nextElement();
59                 Object JavaDoc value = propCall.getProperty(name);
60                 if (Call.SESSION_MAINTAIN_PROPERTY.equals(name)) {
61                     value = Boolean.valueOf((String JavaDoc) value);
62                 }
63                 this.setProperty(name, value);
64
65             }
66         }
67         Properties JavaDoc propStub = service.getStubProperties(portName.getLocalPart());
68         if (propStub != null) {
69             for (Enumeration JavaDoc e = propStub.propertyNames(); e.hasMoreElements();) {
70                 String JavaDoc name = (String JavaDoc) e.nextElement();
71                 if (!Stub.ENDPOINT_ADDRESS_PROPERTY.equals(name)) {
72                     Object JavaDoc value = propStub.getProperty(name);
73                     if (Call.SESSION_MAINTAIN_PROPERTY.equals(name)) {
74                         value = Boolean.valueOf((String JavaDoc) value);
75                     }
76                     this.setProperty(name, value);
77                 }
78             }
79
80         }
81     }
82 }
83
Popular Tags