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.PortComponentHandlerType;
20  import com.sun.java.xml.ns.j2Ee.PortComponentType;
21  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.AbstractWSCFPortComponent;
22  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFHandler;
23  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFPortComponent;
24  
25  /***
26   * This encapsulates the level 2 Elemenr PortComponent which is a child element of the webservice-description element.
27   * It is also the concrete implmentation of the WSCFPortComponent.
28   */
29  public class WSCFPortComponentImpl extends AbstractWSCFPortComponent implements WSCFPortComponent {
30  
31      public WSCFPortComponentImpl(PortComponentType pc) {
32  //		/////////////assigning the values //////////////
33          this.description = XMLBeansUtils.getStringValue(pc.getDescription());
34          this.displayName = XMLBeansUtils.getStringValue(pc.getDisplayName());
35          IconType icon = pc.getIcon();
36          if (icon != null) {
37              this.smallIcon = XMLBeansUtils.getStringValue(icon.getSmallIcon());
38              this.largeIcon = XMLBeansUtils.getStringValue(icon.getLargeIcon());
39          }
40          this.portComponentName = XMLBeansUtils.getStringValue(pc.getPortComponentName());
41          this.serviceEndpointInterface = XMLBeansUtils.getStringValue(pc.getServiceEndpointInterface());
42          this.wsdlPort = new WSCFWSDLPortImpl(pc.getWsdlPort());
43          this.serviceImplBean = new WSCFServiceImplBeanImpl(pc.getServiceImplBean());
44          PortComponentHandlerType[] list = pc.getHandlerArray();
45          for (int i = 0; i < list.length; i++) {
46              WSCFHandler handler = new WSCFHandlerImpl(list[i]);
47              this.handlers.put(handler.getHandlerName(), handler);
48          }
49      }
50  
51  }