KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > wsgen > generator > ews > wsdltoj2ee > wscf > JOnASWSCFHandler


1 /**
2  * JOnAS : Java(TM) OpenSource Application Server
3  * Copyright (C) 2004 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  * --------------------------------------------------------------------------
22  * $Id: JOnASWSCFHandler.java,v 1.2 2004/11/29 14:32:19 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.wscf;
26
27 import java.util.HashMap JavaDoc;
28 import java.util.Iterator JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.Vector JavaDoc;
31
32 import javax.xml.namespace.QName JavaDoc;
33
34 import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.AbstractWSCFHandler;
35
36 import org.objectweb.jonas_lib.deployment.api.HandlerDesc;
37
38
39 /**
40  * JOnAS WSCFHandler implementation.
41  * That's used to fit into the EWS model.
42  * @author Guillaume Sauthier
43  */

44 public class JOnASWSCFHandler extends AbstractWSCFHandler {
45
46     /**
47      * port-name list
48      */

49     private List JavaDoc portNames;
50
51     /**
52      * @param handler JOnAS Handler implementation
53      */

54     public JOnASWSCFHandler(HandlerDesc handler) {
55         // handler-class
56
this.handlerClass = handler.getHandlerClassName();
57         // handler-name
58
this.handlerName = handler.getName();
59
60         // handler/init-param
61
this.initParam = new HashMap JavaDoc();
62         for (Iterator JavaDoc i = handler.getInitParams().keySet().iterator(); i.hasNext();) {
63             String JavaDoc paramName = (String JavaDoc) i.next();
64             this.initParam.put(paramName, new JOnASWSCFInitParam(paramName, handler.getInitParam(paramName)));
65         }
66
67         // port-name list
68
this.portNames = new Vector JavaDoc();
69         for (Iterator JavaDoc i = handler.getPortNames().iterator(); i.hasNext();) {
70             String JavaDoc sr = (String JavaDoc) i.next();
71             this.portNames.add(sr);
72         }
73
74         // soap-header*
75
this.soapHeader = new Vector JavaDoc();
76         for (Iterator JavaDoc i = handler.getSOAPHeaders().iterator(); i.hasNext();) {
77             QName JavaDoc sh = (QName JavaDoc) i.next();
78             this.soapHeader.add(new JOnASWSCFSOAPHeader(sh));
79         }
80
81         // soap-roles*
82
this.soapRole = new Vector JavaDoc();
83         for (Iterator JavaDoc i = handler.getSOAPRoles().iterator(); i.hasNext();) {
84             String JavaDoc sr = (String JavaDoc) i.next();
85             this.soapRole.add(sr);
86         }
87     }
88
89     /**
90      * Gets the port name of the handler element
91      *
92      * @return port-name
93      */

94     public List JavaDoc getPortNames() {
95         return portNames;
96     }
97 }
98
Popular Tags