001: /**
002: * JOnAS : Java(TM) OpenSource Application Server
003: * Copyright (C) 2004 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JOnASWSCFHandler.java 7560 2005-10-21 13:50:04Z sauthieg $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.wscf;
025:
026: import java.util.HashMap;
027: import java.util.Iterator;
028: import java.util.List;
029: import java.util.Vector;
030:
031: import javax.xml.namespace.QName;
032:
033: import org.apache.ws.ews.context.webservices.server.impl.AbstractWSCFHandler;
034:
035: import org.objectweb.jonas_lib.deployment.api.HandlerDesc;
036:
037: /**
038: * JOnAS WSCFHandler implementation.
039: * That's used to fit into the EWS model.
040: * @author Guillaume Sauthier
041: */
042: public class JOnASWSCFHandler extends AbstractWSCFHandler {
043:
044: /**
045: * port-name list
046: */
047: private List portNames;
048:
049: /**
050: * @param handler JOnAS Handler implementation
051: */
052: public JOnASWSCFHandler(HandlerDesc handler) {
053: // handler-class
054: this .handlerClass = handler.getHandlerClassName();
055: // handler-name
056: this .handlerName = handler.getName();
057:
058: // handler/init-param
059: this .initParam = new HashMap();
060: for (Iterator i = handler.getInitParams().keySet().iterator(); i
061: .hasNext();) {
062: String paramName = (String) i.next();
063: this .initParam.put(paramName, new JOnASWSCFInitParam(
064: paramName, handler.getInitParam(paramName)));
065: }
066:
067: // port-name list
068: this .portNames = new Vector();
069: for (Iterator i = handler.getPortNames().iterator(); i
070: .hasNext();) {
071: String sr = (String) i.next();
072: this .portNames.add(sr);
073: }
074:
075: // soap-header*
076: this .soapHeader = new Vector();
077: for (Iterator i = handler.getSOAPHeaders().iterator(); i
078: .hasNext();) {
079: QName sh = (QName) i.next();
080: this .soapHeader.add(new JOnASWSCFSOAPHeader(sh));
081: }
082:
083: // soap-roles*
084: this .soapRole = new Vector();
085: for (Iterator i = handler.getSOAPRoles().iterator(); i
086: .hasNext();) {
087: String sr = (String) i.next();
088: this .soapRole.add(sr);
089: }
090: }
091:
092: /**
093: * Gets the port name of the handler element
094: *
095: * @return port-name
096: */
097: public List getPortNames() {
098: return portNames;
099: }
100: }
|