Examples of PortData


Examples of org.apache.openejb.core.webservices.PortData

                final Collection<Injection> injections = webContext.getInjections();
                final Context context = webContext.getJndiEnc();
                final Class target = classLoader.loadClass(servlet.servletClass);
                final Map<String, Object> bindings = webContext.getBindings();

                final PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                pojoConfiguration = PojoUtil.findPojoConfig(pojoConfiguration, appInfo, webApp);

                final HttpListener container = createPojoWsContainer(classLoader, moduleBaseUrl, port, portInfo.serviceLink,
                    target, context, webApp.contextRoot, bindings,
                    new ServiceConfiguration(PojoUtil.findConfiguration(pojoConfiguration, target.getName()), appInfo.services));

                if (wsRegistry != null) {
                    String auth = authMethod;
                    String realm = realmName;
                    String transport = transportGuarantee;

                    if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                        auth = portInfo.authMethod;
                        realm = portInfo.realmName;
                        transport = portInfo.transportGuarantee;
                    }

                    // give servlet a reference to the webservice container
                    final List<String> addresses = wsRegistry.setWsContainer(container, classLoader, webApp.contextRoot, virtualHost, servlet, realm, transport, auth);

                    // one of the registered addresses to be the connonical address
                    final String address = HttpUtil.selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    setWsdl(container, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                    addressesForApp(webApp.moduleId).add(new EndpointInfo(address, port.getWsdlService(), target.getName()));
                }
            } catch (final Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            } finally {
                Thread.currentThread().setContextClassLoader(old);
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                        PortInfo portInfo = ports.get(statelessBeanInfo.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, deploymentInfo.getInjections(), moduleBaseUrl, deploymentInfo.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, deploymentInfo);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(statelessBeanInfo.ejbDeploymentId, location);

                            ClassLoader classLoader = deploymentInfo.getClassLoader();
                            if (wsRegistry != null) {
                                // add servlet to web container
                                List<String> addresses = wsRegistry.addWsContainer(location, container, virtualHost, realmName, transportGuarantee, authMethod, classLoader);

                                // one of the registered addresses to be the connonical address
                                String address = selectSingleAddress(addresses);

                                // register wsdl location
                                portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                ejbAddresses.put(bean.ejbDeploymentId, address);
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(), e);
                        }
                    }
                }
            }
            for (WebAppInfo webApp : appInfo.webApps) {
                WebDeploymentInfo deploymentInfo = containerSystem.getWebDeploymentInfo(webApp.moduleId);
                if (deploymentInfo == null) continue;

                Map<String,PortInfo> ports = new TreeMap<String,PortInfo>();
                for (PortInfo port : webApp.portInfos) {
                    ports.put(port.serviceLink, port);
                }

                URL moduleBaseUrl = null;
                try {
                    moduleBaseUrl = new File(webApp.codebase).toURL();
                } catch (MalformedURLException e) {
                    logger.error("Invalid ejb jar location " + webApp.codebase, e);
                }

                for (ServletInfo servlet : webApp.servlets) {
                    PortInfo portInfo = ports.get(servlet.servletName);
                    if (portInfo == null) continue;

                    try {
                        ClassLoader classLoader = deploymentInfo.getClassLoader();
                        Collection<Injection> injections = deploymentInfo.getInjections();
                        Context context = deploymentInfo.getJndiEnc();
                        Class target = classLoader.loadClass(servlet.servletClass);

                        PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                        HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                        if (wsRegistry != null) {
                            // give servlet a reference to the webservice container
                            List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                            // one of the registered addresses to be the connonical address
                            String address = selectSingleAddress(addresses);

                            // add address to global registry
                            portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                            logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                            servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                        }
                    } catch (Throwable e) {
                        logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
                    }
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

import java.net.URL;
import java.net.MalformedURLException;

public class WsBuilder {
    public static PortData toPortData(PortInfo port, Collection<Injection> injections, URL baseUrl, ClassLoader classLoader) throws OpenEJBException {
        PortData portData = new PortData();
        portData.setPortId(port.portId);
        if (port.serviceName != null && port.serviceName.length() != 0) {
            portData.setServiceName(QName.valueOf(port.serviceName));
        }
        if (port.portName != null && port.portName.length() != 0) {
            portData.setPortName(QName.valueOf(port.portName));
        }
        portData.setWsdlUrl(getWsdlURL(port.wsdlFile, baseUrl, classLoader));
        portData.getHandlerChains().addAll(toHandlerChainData(port.handlerChains, classLoader));
        portData.getInjections().addAll(injections);
        portData.setMtomEnabled(port.mtomEnabled);
        portData.setBindingID(port.binding);
        portData.setWsdlPort(port.wsdlPort);
        portData.setWsdlService(port.wsdlService);
        portData.setLocation(port.location);
        return portData;
    }
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

import java.util.Collection;
import java.util.List;

public class WsBuilder {
    public static PortData toPortData(final PortInfo port, final Collection<Injection> injections, final URL baseUrl, final ClassLoader classLoader) throws OpenEJBException {
        final PortData portData = new PortData();
        portData.setPortId(port.portId);
        if (port.serviceName != null && port.serviceName.length() != 0) {
            portData.setServiceName(QName.valueOf(port.serviceName));
        }
        if (port.portName != null && port.portName.length() != 0) {
            portData.setPortName(QName.valueOf(port.portName));
        }
        portData.setWsdlUrl(getWsdlURL(port.wsdlFile, baseUrl, classLoader));
        portData.getHandlerChains().addAll(toHandlerChainData(port.handlerChains, classLoader));
        portData.getInjections().addAll(injections);
        portData.setMtomEnabled(port.mtomEnabled);
        portData.setBindingID(port.binding);
        portData.setWsdlPort(port.wsdlPort);
        portData.setWsdlService(port.wsdlService);
        portData.setLocation(port.location);

        portData.setSecure("WS-SECURITY".equals(port.authMethod));
        portData.setProperties(port.properties);

        return portData;
    }
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, deploymentInfo.getInjections(), moduleBaseUrl, deploymentInfo.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, deploymentInfo);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = deploymentInfo.getClassLoader();
                            if (wsRegistry != null) {
                                String auth = authMethod;
                                String realm = realmName;
                                String transport = transportGuarantee;

                                if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                    auth = portInfo.authMethod;
                                    realm = portInfo.realmName;
                                    transport = portInfo.transportGuarantee;
                                }

                                List<String> addresses = wsRegistry.addWsContainer(location, container, virtualHost, realm, transport, auth, classLoader);

                                // one of the registered addresses to be the connonical address
                                String address = selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(), e);
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                ClassLoader classLoader = deploymentInfo.getClassLoader();
                Collection<Injection> injections = deploymentInfo.getInjections();
                Context context = deploymentInfo.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, deploymentInfo.getInjections(), moduleBaseUrl, deploymentInfo.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, deploymentInfo);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = deploymentInfo.getClassLoader();
                            if (wsRegistry != null) {
                                String auth = authMethod;
                                String realm = realmName;
                                String transport = transportGuarantee;

                                if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                    auth = portInfo.authMethod;
                                    realm = portInfo.realmName;
                                    transport = portInfo.transportGuarantee;
                                }

                                List<String> addresses = wsRegistry.addWsContainer(location, container, virtualHost, realm, transport, auth, classLoader);

                                // one of the registered addresses to be the connonical address
                                String address = selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(), e);
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                ClassLoader classLoader = deploymentInfo.getClassLoader();
                Collection<Injection> injections = deploymentInfo.getInjections();
                Context context = deploymentInfo.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                        PortInfo portInfo = ports.get(statelessBeanInfo.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, deploymentInfo.getInjections(), moduleBaseUrl, deploymentInfo.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, deploymentInfo);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(statelessBeanInfo.ejbDeploymentId, location);

                            ClassLoader classLoader = deploymentInfo.getClassLoader();
                            if (wsRegistry != null) {
                                // add servlet to web container
                                List<String> addresses = wsRegistry.addWsContainer(location, container, virtualHost, realmName, transportGuarantee, authMethod, classLoader);

                                // one of the registered addresses to be the connonical address
                                String address = selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(), e);
View Full Code Here

Examples of org.apache.openejb.core.webservices.PortData

                ClassLoader classLoader = deploymentInfo.getClassLoader();
                Collection<Injection> injections = deploymentInfo.getInjections();
                Context context = deploymentInfo.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
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.