01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2005 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: */package org.objectweb.jonas.ws.axis;
21:
22: import java.util.Enumeration;
23: import java.util.Properties;
24:
25: import javax.xml.namespace.QName;
26: import javax.xml.rpc.Stub;
27:
28: import org.apache.axis.client.Call;
29:
30: /**
31: * JCall is the JOnAS J2EE layer on top of axis Call implementation.
32: * It is used to assign Call properties.
33: * @author Jerome Camilleri
34: */
35: public class JCall extends Call {
36:
37: /**
38: * @see org.apache.axis.client.Call#Call(Service)
39: */
40: public JCall(JService service) {
41: super (service);
42: }
43:
44: /**
45: * Sets the port name of this Call object. This call will not set
46: * any additional fields, nor will it do any checking to verify that
47: * this port name is actually defined in the WSDL - for now anyway.
48: *
49: * @param portName Fully qualified name of the port
50: */
51: public void setPortName(QName portName) {
52: super .setPortName(portName);
53: JService service = (JService) this .getService();
54: Properties propCall = service.getCallProperties(portName
55: .getLocalPart());
56: if (propCall != null) {
57: for (Enumeration e = propCall.propertyNames(); e
58: .hasMoreElements();) {
59: String name = (String) e.nextElement();
60: Object value = propCall.getProperty(name);
61: if (Call.SESSION_MAINTAIN_PROPERTY.equals(name)) {
62: value = Boolean.valueOf((String) value);
63: }
64: this .setProperty(name, value);
65:
66: }
67: }
68: Properties propStub = service.getStubProperties(portName
69: .getLocalPart());
70: if (propStub != null) {
71: for (Enumeration e = propStub.propertyNames(); e
72: .hasMoreElements();) {
73: String name = (String) e.nextElement();
74: if (!Stub.ENDPOINT_ADDRESS_PROPERTY.equals(name)) {
75: Object value = propStub.getProperty(name);
76: if (Call.SESSION_MAINTAIN_PROPERTY.equals(name)) {
77: value = Boolean.valueOf((String) value);
78: }
79: this.setProperty(name, value);
80: }
81: }
82:
83: }
84: }
85: }
|