Examples of PortComponent


Examples of org.apache.openejb.jee.PortComponent

                        webserviceDescription.setWebserviceDescriptionName(serviceName);
                        webservices.getWebserviceDescription().add(webserviceDescription);
                    }

                    // define port if not already declared
                    PortComponent portComponent = portMap.get(servlet.getServletName());
                    if (portComponent == null) {
                        portComponent = new PortComponent();
                        portComponent.setPortComponentName(clazz.getSimpleName());
                        ServiceImplBean serviceImplBean = new ServiceImplBean();
                        serviceImplBean.setServletLink(servlet.getServletName());
                        portComponent.setServiceImplBean(serviceImplBean);

                        webserviceDescription.getPortComponent().add(portComponent);
                    }

                    // default portId == moduleId.servletName
                    if (portComponent.getId() == null) {
                        portComponent.setId(webModule.getModuleId() + "." + servlet.getServletName());
                    }
                    if (webserviceDescription.getId() == null) {
                        webserviceDescription.setId(webModule.getModuleId() + "." + servlet.getServletName());
                    }

                    // set port values from annotations if not already set
                    if (portComponent.getServiceEndpointInterface() == null) {
                        portComponent.setServiceEndpointInterface(JaxWsUtils.getServiceInterface(clazz));
                    }
                    if (portComponent.getWsdlPort() == null) {
                        portComponent.setWsdlPort(JaxWsUtils.getPortQName(clazz));
                    }
                    if (webserviceDescription.getWsdlFile() == null) {
                        webserviceDescription.setWsdlFile(JaxWsUtils.getServiceWsdlLocation(clazz, webModule.getClassLoader()));
                    }
                    if (portComponent.getWsdlService() == null) {
                        Definition definition = getWsdl(webModule, webserviceDescription.getWsdlFile());
                        if (definition != null && definition.getServices().size() ==  1) {
                            QName serviceQName = (QName) definition.getServices().keySet().iterator().next();
                            portComponent.setWsdlService(serviceQName);
                        } else {
                            portComponent.setWsdlService(JaxWsUtils.getServiceQName(clazz));
                        }
                    }
                    if (portComponent.getProtocolBinding() == null) {
                        portComponent.setProtocolBinding(JaxWsUtils.getBindingUriFromAnn(clazz));
                    }
                    if (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding()) ||
                            SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding())) {
                        portComponent.setEnableMtom(true);
                    }

                    // handlers
                    if (portComponent.getHandlerChains() == null) {
                        HandlerChains handlerChains = getHandlerChains(clazz, portComponent.getServiceEndpointInterface(), webModule.getClassLoader());
                        portComponent.setHandlerChains(handlerChains);

                    }
                }
            } catch (Exception e) {
                throw new OpenEJBException("Unable to load servlet class: " + className, e);
View Full Code Here

Examples of org.apache.openejb.jee.PortComponent

                }
                webservices.getWebserviceDescription().add(webserviceDescription);
            }

            // add a port component if we don't alrady have one
            PortComponent portComponent = portMap.get(sessionBean.getEjbName());
            if (portComponent == null) {
                portComponent = new PortComponent();
                if (webserviceDescription.getPortComponentMap().containsKey(JaxWsUtils.getPortQName(ejbClass).getLocalPart())) {
                    // when to webservices.xml is defined and when we want to
                    // publish more than one port for the same implementation by configuration
                    portComponent.setPortComponentName(sessionBean.getEjbName());
       
    } else { // JAX-WS Metadata specification default
        portComponent.setPortComponentName(JaxWsUtils.getPortQName(ejbClass).getLocalPart());
       
    }
                webserviceDescription.getPortComponent().add(portComponent);

                ServiceImplBean serviceImplBean = new ServiceImplBean();
                serviceImplBean.setEjbLink(sessionBean.getEjbName());
                portComponent.setServiceImplBean(serviceImplBean);

                // Checking if MTOM must be enabled
                if (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding()) ||
                        SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding())) {
                    portComponent.setEnableMtom(true);
                }
               
            }

            // default portId == deploymentId
            if (portComponent.getId() == null) {
                portComponent.setId(deployment.getDeploymentId());
            }
            if (webserviceDescription.getId() == null) {
                webserviceDescription.setId(deployment.getDeploymentId());
            }

            // set service endpoint interface
            if (portComponent.getServiceEndpointInterface() == null) {
                portComponent.setServiceEndpointInterface(sessionBean.getServiceEndpoint());
            }

            // default location is /@WebService.serviceName/@WebService.name
            if (JaxWsUtils.isWebService(ejbClass)) {
                if (portComponent.getWsdlPort() == null) {
                    portComponent.setWsdlPort(JaxWsUtils.getPortQName(ejbClass));
                }
                if (webserviceDescription.getWsdlFile() == null) {
                    webserviceDescription.setWsdlFile(JaxWsUtils.getServiceWsdlLocation(ejbClass, ejbModule.getClassLoader()));
                }
                if (portComponent.getWsdlService() == null) {
                    Definition definition = getWsdl(ejbModule, webserviceDescription.getWsdlFile());
                    if (definition != null && definition.getServices().size() ==  1) {
                        QName serviceQName = (QName) definition.getServices().keySet().iterator().next();
                        portComponent.setWsdlService(serviceQName);
                    } else {
                        portComponent.setWsdlService(JaxWsUtils.getServiceQName(ejbClass));
                    }
                }
                if (portComponent.getLocation() == null && webserviceDescription.getWsdlFile() != null) {
                    // set location based on wsdl port
                    Definition definition = getWsdl(ejbModule, webserviceDescription.getWsdlFile());
                    String locationURI = getLocationFromWsdl(definition, portComponent);
                    portComponent.setLocation(locationURI);
                }
                if (portComponent.getProtocolBinding() == null) {
                    portComponent.setProtocolBinding(JaxWsUtils.getBindingUriFromAnn(ejbClass));
                }

                // handlers
                if (portComponent.getHandlerChains() == null) {
                    HandlerChains handlerChains = getHandlerChains(ejbClass, sessionBean.getServiceEndpoint(), ejbModule.getClassLoader());
                    portComponent.setHandlerChains(handlerChains);

                }
            } else {
                // todo location JAX-RPC services comes from wsdl file
            }
View Full Code Here

Examples of org.apache.openejb.jee.PortComponent

    }

    private JaxRpcServiceInfo getJaxRpcServiceInfo(ClassLoader classLoader) throws OpenEJBException {
        JavaWsdlMapping mapping = null; // the java to wsdl mapping file
        CommonsSchemaInfoBuilder xmlBeansSchemaInfoBuilder = new CommonsSchemaInfoBuilder(null, null); // the schema data from the wsdl file
        PortComponent portComponent = null; // webservice.xml declaration of this service
        Port port = null; // wsdl.xml declaration of this service
        String wsdlFile = null;

        XmlSchemaInfo schemaInfo = xmlBeansSchemaInfoBuilder.createSchemaInfo();
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

            // set JNDI names
            wsEjbMD.setJndiName(sessionEjbMD.determineJndiName());
            wsEjbMD.setLocalJndiName(jbossEjbMD.determineLocalJndiName());

            final PortComponent portComponentMD = sessionEjbMD.getPortComponent();
            if (portComponentMD != null)
            {
               // set port component meta data
               wsEjbMD.setPortComponentName(portComponentMD.getPortComponentName());
               wsEjbMD.setPortComponentURI(portComponentMD.getPortComponentURI());

               // set security meta data
               final EJBSecurityMetaData smd = new EJBSecurityMetaData();
               smd.setAuthMethod(portComponentMD.getAuthMethod());
               smd.setTransportGuarantee(portComponentMD.getTransportGuarantee());
               smd.setSecureWSDLAccess(portComponentMD.getSecureWSDLAccess());
               wsEjbMD.setSecurityMetaData(smd);
            }
         }

         wsEjbsMD.add(wsEjbMD);
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

   private void addWebServiceAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean)
   {
      if (enterpriseBean != null && (enterpriseBean instanceof JBossSessionBeanMetaData))
      {
         PortComponent pc = ((JBossSessionBeanMetaData)enterpriseBean).getPortComponent();
         if (pc != null)
         {
            PortComponentMD annotation = new PortComponentMD();
            annotation.setAuthMethod(pc.getAuthMethod());
            annotation.setPortComponentName(pc.getPortComponentName());
            annotation.setPortComponentURI(pc.getPortComponentURI());
            annotation.setSecureWSDLAccess(pc.getSecureWSDLAccess());
            annotation.setTransportGuarantee(pc.getTransportGuarantee());
           
            addClassAnnotation(container, PortComponentSpec.class, annotation);
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

   private void addWebServiceAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean)
   {
      if (enterpriseBean != null && (enterpriseBean instanceof JBossSessionBeanMetaData))
      {
         PortComponent pc = ((JBossSessionBeanMetaData)enterpriseBean).getPortComponent();
         if (pc != null)
         {
            PortComponentMD annotation = new PortComponentMD();
            annotation.setAuthMethod(pc.getAuthMethod());
            annotation.setPortComponentName(pc.getPortComponentName());
            annotation.setPortComponentURI(pc.getPortComponentURI());
            annotation.setSecureWSDLAccess(pc.getSecureWSDLAccess());
            annotation.setTransportGuarantee(pc.getTransportGuarantee());
           
            addClassAnnotation(container, PortComponentSpec.class, annotation);
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

   private void addWebServiceAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean)
   {
      if (enterpriseBean != null && (enterpriseBean instanceof JBossSessionBeanMetaData))
      {
         PortComponent pc = ((JBossSessionBeanMetaData)enterpriseBean).getPortComponent();
         if (pc != null)
         {
            PortComponentMD annotation = new PortComponentMD();
            annotation.setAuthMethod(pc.getAuthMethod());
            annotation.setPortComponentName(pc.getPortComponentName());
            annotation.setPortComponentURI(pc.getPortComponentURI());
            annotation.setSecureWSDLAccess(pc.getSecureWSDLAccess());
            annotation.setTransportGuarantee(pc.getTransportGuarantee());
           
            addClassAnnotation(container, PortComponentSpec.class, annotation);
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

   private void addWebServiceAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean)
   {
      if (enterpriseBean != null && (enterpriseBean instanceof JBossSessionBeanMetaData))
      {
         PortComponent pc = ((JBossSessionBeanMetaData)enterpriseBean).getPortComponent();
         if (pc != null)
         {
            PortComponentMD annotation = new PortComponentMD();
            annotation.setAuthMethod(pc.getAuthMethod());
            annotation.setPortComponentName(pc.getPortComponentName());
            annotation.setPortComponentURI(pc.getPortComponentURI());
            annotation.setSecureWSDLAccess(pc.getSecureWSDLAccess());
            annotation.setTransportGuarantee(pc.getTransportGuarantee());
           
            addClassAnnotation(container, PortComponentSpec.class, annotation);
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

         targetBean.setHome(jbossSessionBean.getHome());
         targetBean.setLocalHome(jbossSessionBean.getLocalHome());
         targetBean.setJndiName(jbossSessionBean.determineJndiName());
         targetBean.setLocalJndiName(jbossBeansMetaData.determineLocalJndiName());
        
         PortComponent pcmd = jbossSessionBean.getPortComponent();
         if (pcmd != null)
         {
            targetBean.setPortComponentName(pcmd.getPortComponentName());
            targetBean.setPortComponentURI(pcmd.getPortComponentURI());
            EJBSecurityMetaData smd = new EJBSecurityMetaData();
            smd.setAuthMethod(pcmd.getAuthMethod());
            smd.setTransportGuarantee(pcmd.getTransportGuarantee());
            smd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
            targetBean.setSecurityMetaData(smd);
         }
      }
      else if (jbossBeansMetaData.isMessageDriven())
      {
View Full Code Here

Examples of org.jboss.metadata.javaee.spec.PortComponent

      JBossXBTestDelegate xbdelegate = (JBossXBTestDelegate) super.getDelegate();
      xbdelegate.setValidateSchema(true);
      JBossMetaData jboss = unmarshal();
      JBossGenericBeanMetaData ejb = (JBossGenericBeanMetaData) jboss.getEnterpriseBean("EjbName");
      assertNotNull(ejb);
      PortComponent portComponent = ejb.getPortComponent();
      assertNotNull(portComponent);
      assertEquals("port.component.name", portComponent.getPortComponentName());
      assertEquals("port/component/uri", portComponent.getPortComponentURI());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.