Package org.apache.geronimo.jaxws

Examples of org.apache.geronimo.jaxws.PortInfo


    }

    private PortInfo getPortInfo(ServletType servletType,
                                 Bundle bundle,
                                 Map portLocations) throws DeploymentException {
        PortInfo portInfo = null;
        if (servletType.isSetServletClass()) {
            String servletClassName = servletType.getServletClass().getStringValue().trim();
            try {
                Class servletClass = bundle.loadClass(servletClassName);
                if (JAXWSUtils.isWebService(servletClass)) {
View Full Code Here


        }
        return portInfo;
    }

    private PortInfo createPortInfo(String servlet, Map portLocations) {
        PortInfo portInfo = new PortInfo();
        String location = (String)portLocations.get(servlet);
        if (location != null) {
            portInfo.setLocation(location);
        }
        return portInfo;
    }
View Full Code Here

        Map portInfoMap = (Map) sharedContext.get(getKey());
        if (portInfoMap == null) {
            // not ours
            return false;
        }
        PortInfo portInfo = (PortInfo) portInfoMap.get(servletName);
        if (portInfo == null) {
            // not ours
            return false;
        }

        // verify that the class is loadable and is a JAX-WS web service
        Bundle bundle = context.getDeploymentBundle();
        Class servletClass = loadClass(servletClassName, bundle);
        if (!JAXWSUtils.isWebService(servletClass)) {
            return false;
        }

        Map componentContext = null;
        Holder moduleHolder = null;
        try {
            GBeanData moduleGBean = context.getGBeanInstance(context.getModuleName());
            componentContext = (Map)moduleGBean.getAttribute("componentContext");
            moduleHolder = (Holder)moduleGBean.getAttribute("holder");
        } catch (GBeanNotFoundException e) {
            LOG.warn("ModuleGBean not found. JNDI resource injection will not work.");
        }

        AnnotationHolder serviceHolder =
            (AnnotationHolder)sharedContext.get(WebServiceContextAnnotationHelper.class.getName());
        if (serviceHolder == null) {
            serviceHolder = new AnnotationHolder(moduleHolder);
            sharedContext.put(WebServiceContextAnnotationHelper.class.getName(), serviceHolder);
        }
        WebServiceContextAnnotationHelper.addWebServiceContextInjections(serviceHolder, servletClass);

        String location = portInfo.getLocation();
        LOG.info("Configuring JAX-WS Web Service: " + servletName + " at " + location);

        AbstractName containerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), getContainerFactoryGBeanInfo().getName(), GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
        GBeanData containerFactoryData = new GBeanData(containerFactoryName, getContainerFactoryGBeanInfo());
        containerFactoryData.setAttribute("portInfo", portInfo);
View Full Code Here

        Map portInfoMap = (Map) sharedContext.get(getKey());
        if (portInfoMap == null) {
            // not ours
            return false;
        }
        PortInfo portInfo = (PortInfo) portInfoMap.get(ejbName);
        if (portInfo == null) {
            // not ours
            return false;
        }

        String beanClassName = (String)targetGBean.getAttribute("ejbClass");
        // verify that the class is loadable and is a JAX-WS web service
        Class beanClass = loadClass(beanClassName, bundle);
        if (!JAXWSUtils.isWebService(beanClass)) {
            return false;
        }

        String location = portInfo.getLocation();
        if (location == null) {
            throw new DeploymentException("Endpoint URI for EJB WebService is missing");
        }

        LOG.info("Configuring EJB JAX-WS Web Service: " + ejbName + " at " + location);
View Full Code Here

                    String serviceName = desc.getWebserviceDescriptionName().getStringValue();

                    for (PortComponentType port : desc.getPortComponentArray()) {

                        PortInfo portInfo = new PortInfo();
                        String serviceLink = null;
                        ServiceImplBeanType beanType = port.getServiceImplBean();
                        if (beanType.getEjbLink() != null) {
                            serviceLink = beanType.getEjbLink().getStringValue();
                        } else if (beanType.getServletLink().getStringValue() != null) {
                            serviceLink = beanType.getServletLink().getStringValue();
                        }
                        portInfo.setServiceLink(serviceLink);

                        if (port.getServiceEndpointInterface() != null) {
                            String sei = port.getServiceEndpointInterface().getStringValue();
                            portInfo.setServiceEndpointInterfaceName(sei);
                        }

                        String portName = port.getPortComponentName().getStringValue();
                        portInfo.setPortName(portName);

                        portInfo.setProtocolBinding(port.getProtocolBinding());
                        portInfo.setServiceName(serviceName);
                        portInfo.setWsdlFile(wsdlFile);

                        if (port.getEnableMtom() != null) {
                            portInfo.setEnableMTOM(port.getEnableMtom().getBooleanValue());
                        }

                        if (port.getHandlerChains() != null) {
                            StringBuffer chains = new StringBuffer("<handler-chains xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
                            chains.append(port.getHandlerChains().xmlText());
                            chains.append("</handler-chains>");
                            portInfo.setHandlersAsXML(chains.toString());
                        }

                        if (port.getWsdlPort() != null) {
                            portInfo.setWsdlPort(port.getWsdlPort().getQNameValue());
                        }

                        if (port.getWsdlService() != null) {
                            portInfo.setWsdlService(port.getWsdlService().getQNameValue());
                        }

                        String location = (String) correctedPortLocations.get(serviceLink);
                        portInfo.setLocation(location);

                        if (map == null) {
                            map = new HashMap<String, PortInfo>();
                        }
View Full Code Here

                String serviceName = desc.getWebserviceDescriptionName().getValue();

                for (PortComponentType port : desc.getPortComponent()) {

                    PortInfo portInfo = new PortInfo();

                    String serviceLink = null;
                    ServiceImplBeanType beanType = port.getServiceImplBean();
                    if (beanType.getEjbLink() != null) {
                        serviceLink = beanType.getEjbLink().getValue();
                    } else if (beanType.getServletLink().getValue() != null) {
                        serviceLink = beanType.getServletLink().getValue();
                    }
                    portInfo.setServiceLink(serviceLink);

                    if (port.getServiceEndpointInterface() != null) {
                        String sei = port.getServiceEndpointInterface().getValue();
                        portInfo.setServiceEndpointInterfaceName(sei);
                    }

                    String portName = port.getPortComponentName().getValue();
                    portInfo.setPortName(portName);

                    portInfo.setProtocolBinding(port.getProtocolBinding());
                    portInfo.setServiceName(serviceName);
                    portInfo.setWsdlFile(wsdlFile);

                    if (port.getEnableMtom() != null) {
                        portInfo.setEnableMTOM(port.getEnableMtom().isValue());
                    }

                    portInfo.setHandlers(HandlerChainsType.class, port.getHandlerChains());

                    if (port.getWsdlPort() != null) {
                        portInfo.setWsdlPort(port.getWsdlPort().getValue());
                    }

                    if (port.getWsdlService() != null) {
                        portInfo.setWsdlService(port.getWsdlService().getValue());
                    }

                    String location = (String) correctedPortLocations.get(serviceLink);
                    portInfo.setLocation(location);

                    if (map == null) {
                        map = new HashMap<String, PortInfo>();
                    }
                    map.put(serviceLink, portInfo);
View Full Code Here

            if (isProperWebService(clazz)) {
                LOG.debug("Found web service class: " + clazz.getName());
                if (map == null) {
                    map = new HashMap<String, PortInfo>();
                }
                PortInfo portInfo = new PortInfo();
                String location = (String) correctedPortLocations.get(clazz.getName());
                portInfo.setLocation(location);
                map.put(clazz.getName(), portInfo);
            }
        }
        return map;
    }
View Full Code Here

        Map portInfoMap = (Map) sharedContext.get(getKey());
        if (portInfoMap == null) {
            // not ours
            return false;
        }
        PortInfo portInfo = (PortInfo) portInfoMap.get(servletName);
        if (portInfo == null) {
            // not ours
            return false;
        }
View Full Code Here

        Map portInfoMap = (Map) sharedContext.get(getKey());
        if (portInfoMap == null) {
            // not ours
            return false;
        }
        PortInfo portInfo = (PortInfo) portInfoMap.get(ejbName);
        if (portInfo == null) {
            // not ours
            return false;
        }
       
        String shortEjbName = (String)targetGBean.getAttribute("ejbName");
               
        // FIXME: kind of a hack now, need better solution
        String location = portInfo.getLocation();
        if (location == null) {           
            location = "/" + trimPath(new File(moduleFile.getName()).getName()) + "/" + shortEjbName;
            portInfo.setLocation(location);
        }

        LOG.info("Configuring EJB Web Service: " + ejbName + " at " + location);
       
        targetGBean.setAttribute("portInfo", portInfo);
View Full Code Here

            }           
            try {
                Class ejbClass = classLoader.loadClass(bean.ejbClass);
                if (JAXWSUtils.isWebService(ejbClass)) {
                    LOG.debug("Found EJB Web Service: " + bean.ejbName);
                    PortInfo portInfo = new PortInfo();
                    String location = (String) correctedPortLocations.get(bean.ejbName);
                    if (location == null) {
                        // set default location, i.e. /@WebService.serviceName/@WebService.name
                        location = "/" + JAXWSUtils.getServiceName(ejbClass) + "/" + JAXWSUtils.getName(ejbClass);
                    }
                    portInfo.setLocation(location);
                    map.put(bean.ejbName, portInfo);
                }
            } catch (Exception e) {
                throw new DeploymentException("Failed to load ejb class "
                                              + bean.ejbName, e);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.jaxws.PortInfo

Copyright © 2018 www.massapicom. 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.