Package org.jboss.wsf.spi.metadata.jms

Examples of org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData


                this.newHttpEndpoint(servletClass, servletName, dep);
            }
        }

        final JMSEndpointsMetaData jmsEndpointsMD = ASHelper.getOptionalAttachment(unit, WSAttachmentKeys.JMS_ENDPOINT_METADATA_KEY);
        if (jmsEndpointsMD != null) {
            dep.addAttachment(JMSEndpointsMetaData.class, jmsEndpointsMD);
            for (JMSEndpointMetaData endpoint : jmsEndpointsMD.getEndpointsMetaData()) {
                if (endpoint.getName() == null) {
                    endpoint.setName(endpoint.getImplementor());
                }
                this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), endpoint.getSoapAddress(), dep);
            }
View Full Code Here


            }
        }

        //extract SOAP-over-JMS 1.0 bindings
        if (!map.isEmpty()) {
            final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
            final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
            final UnifiedVirtualFile uvf = new VirtualFileAdaptor(deploymentRoot.getRoot());

            final boolean trace = LOG.isTraceEnabled();
            for (String wsdlLocation : map.keySet()) {
                if (trace) {
                    LOG.tracef("Scanning wsdlLocation: %s", wsdlLocation);
                }
                try {
                    URL url = uvf.findChild(wsdlLocation).toURL();
                    SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
                    for (AnnotationInstance ai : map.get(wsdlLocation)) {
                        String port = ai.value(PORT_NAME).asString();
                        String service = ai.value(SERVICE_NAME).asString();
                        AnnotationValue targetNS = ai.value(TARGET_NAMESPACE);
                        String tns = targetNS != null ? targetNS.asString() : null;
                        QName serviceName = new QName(tns, service);
                        QName portName = new QName(tns, port);
                        if (trace) {
                            LOG.tracef("  serviceName: %s", serviceName);
                            LOG.tracef("  portName: %s", portName);
                        }
                        String soapAddress = parser.filterSoapAddress(serviceName, portName, SOAPAddressWSDLParser.SOAP_OVER_JMS_NS);
                        if (soapAddress != null) {
                            ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
                            String beanClassName = webServiceClassInfo.name().toString();
                            //service name ?
                            JMSEndpointMetaData endpointMetaData = new JMSEndpointMetaData(endpointsMetaData);
                            endpointMetaData.setEndpointName(port);
                            endpointMetaData.setImplementor(beanClassName);
                            //endpointMetaData.setName(name);
                            endpointMetaData.setSoapAddress(soapAddress);
                            endpointMetaData.setWsdlLocation(wsdlLocation);
                            endpointsMetaData.addEndpointMetaData(endpointMetaData);
                        }
                    }
                } catch (Exception e) {
                    if (trace) {
                        LOG.warnf("Could not read WSDL at '%s'", wsdlLocation, e);
                    } else {
                        LOG.warnf("Could not read WSDL at '%s'", wsdlLocation);
                    }
                }
            }

            if (!endpointsMetaData.getEndpointsMetaData().isEmpty()) {
                unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
            }
        }
    }
View Full Code Here

        throw new IllegalStateException();
    }

    private static boolean isJmsEndpoint(final DeploymentUnit unit, final ClassInfo classInfo) {
        final String endpointClassName = classInfo.name().toString();
        final JMSEndpointsMetaData jmsEndpointsMD = getRequiredAttachment(unit, JMS_ENDPOINT_METADATA_KEY);
        for (final JMSEndpointMetaData endpoint : jmsEndpointsMD.getEndpointsMetaData()) {
            if (endpointClassName.equals(endpoint.getImplementor())) return true;
        }
        return false;
    }
View Full Code Here

                annotations.add(webServiceAnnotation);
            }
        }

        //extract SOAP-over-JMS 1.0 bindings
        final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
        if (!map.isEmpty()) {

            for (String wsdlLocation : map.keySet()) {
                try {
                    final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
                    if (resourceRoot == null) continue;
                    final VirtualFile wsdlLocationFile = resourceRoot.getRoot().getChild(wsdlLocation);
                    final URL url = wsdlLocationFile.toURL();
                    SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
                    for (AnnotationInstance ai : map.get(wsdlLocation)) {
                        String port = ai.value(PORT_NAME).asString();
                        String service = ai.value(SERVICE_NAME).asString();
                        AnnotationValue targetNS = ai.value(TARGET_NAMESPACE);
                        String tns = targetNS != null ? targetNS.asString() : null;
                        QName serviceName = new QName(tns, service);
                        QName portName = new QName(tns, port);
                        String soapAddress = parser.filterSoapAddress(serviceName, portName, SOAPAddressWSDLParser.SOAP_OVER_JMS_NS);
                        if (soapAddress != null) {
                            ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
                            String beanClassName = webServiceClassInfo.name().toString();
                            //service name ?
                            JMSEndpointMetaData endpointMetaData = new JMSEndpointMetaData(endpointsMetaData);
                            endpointMetaData.setEndpointName(port);
                            endpointMetaData.setName(beanClassName);
                            endpointMetaData.setImplementor(beanClassName);
                            //endpointMetaData.setName(name);
                            endpointMetaData.setSoapAddress(soapAddress);
                            endpointMetaData.setWsdlLocation(wsdlLocation);
                            endpointsMetaData.addEndpointMetaData(endpointMetaData);
                        }
                    }
                } catch (Exception ignore) {
                    ROOT_LOGGER.cannotReadWsdl(wsdlLocation);
                }
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData

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.