View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.geronimo.ews.ws4j2ee.context.webservices.server.xmlbeans;
17  
18  import com.sun.java.xml.ns.j2Ee.IconType;
19  import com.sun.java.xml.ns.j2Ee.ParamValueType;
20  import com.sun.java.xml.ns.j2Ee.PortComponentHandlerType;
21  import com.sun.java.xml.ns.j2Ee.XsdQNameType;
22  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.AbstractWSCFHandler;
23  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFHandler;
24  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFInitParam;
25  
26  /***
27   * This encapsulates the layer 3 handler element of the webservices.xml. This
28   * is also the concrete implementation of the WSCFHandler.
29   */
30  public class WSCFHandlerImpl extends AbstractWSCFHandler implements WSCFHandler {
31      public WSCFHandlerImpl(PortComponentHandlerType handler) {
32          this.description = XMLBeansUtils.getStringValue(handler.getDescriptionArray());
33          this.displayName = XMLBeansUtils.getStringValue(handler.getDisplayNameArray());
34          IconType[] icons = handler.getIconArray();
35          if (icons.length > 0) {
36              this.smallIcon = XMLBeansUtils.getStringValue(icons[0].getSmallIcon());
37              this.largeIcon = XMLBeansUtils.getStringValue(icons[0].getLargeIcon());
38          }
39          this.handlerName = XMLBeansUtils.getStringValue(handler.getHandlerName());
40          this.handlerClass = XMLBeansUtils.getStringValue(handler.getHandlerName());
41          ParamValueType[] list = handler.getInitParamArray();
42          for (int i = 0; i < list.length; i++) {
43              WSCFInitParam initParameters = new WSCFInitParamImpl(list[i]);
44              this.initParam.put(initParameters.getParamName(), initParameters);
45          }
46          XsdQNameType[] list2 = handler.getSoapHeaderArray();
47          for (int i = 0; i < list2.length; i++) {
48              this.soapHeader.add(new WSCFSOAPHeaderImpl(list2[i]));
49          }
50          com.sun.java.xml.ns.j2Ee.String[] list3 = handler.getSoapRoleArray();
51          for (int i = 0; i < list3.length; i++) {
52              this.soapRole.add(XMLBeansUtils.getStringValue(list3[i]));
53          }
54      }
55  }