Package org.apache.cxf.tools.common.model

Examples of org.apache.cxf.tools.common.model.JavaPort


        }
        model.addServiceClass(name, sclz);
    }

    private JavaPort processPort(JavaModel model, EndpointInfo port) throws ToolException {
        JavaPort jport = new JavaPort(NameUtil.mangleNameToClassName(port.getName().getLocalPart()));
        jport.setPortName(port.getName().getLocalPart());
        BindingInfo binding = port.getBinding();
        jport.setBindingAdress(port.getAddress());
        jport.setBindingName(binding.getName().getLocalPart());
       
        String namespace = binding.getInterface().getName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));
        jport.setPackageName(packageName);

        InterfaceInfo infInfo = binding.getInterface();
             
        String portType = binding.getInterface().getName().getLocalPart();
        jport.setPortType(portType);
       
        JAXWSBinding infBinding = infInfo.getExtensor(JAXWSBinding.class);
       
        if (infBinding != null) {
            if (!infBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(false);
            }
       
            if (!infBinding.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(false);
            }

            if (infBinding.getPackage() != null) {
                jaxwsBinding.setPackage(infBinding.getPackage());
            }
        }

        if (jaxwsBinding.getPackage() != null) {
            jport.setPackageName(jaxwsBinding.getPackage());
        }
       
        if (infBinding != null && infBinding.getJaxwsClass() != null
            && infBinding.getJaxwsClass().getClassName() != null) {
            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
            jport.setInterfaceClass(className);
        } else {
            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
        }

        bindingType = getBindingType(binding);
       
        if (bindingType == null) {
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message("BINDING_SPECIFY_ONE_PROTOCOL",
                                                       LOG,
                                                       binding.getName());
            throw new ToolException(msg);
        }

        if (isSoapBinding()) {
            SoapBinding spbd = SOAPBindingUtil.getProxy(SoapBinding.class, this.bindingObj);
            jport.setStyle(SOAPBindingUtil.getSoapStyle(spbd.getStyle()));
            jport.setTransURI(spbd.getTransportURI());
        }

        Collection<BindingOperationInfo> operations = binding.getOperations();
        for (BindingOperationInfo bop : operations) {
            processOperation(model, bop, binding);
View Full Code Here


        Iterator it = javaModel.getServiceClasses().values().iterator();
        while (it.hasNext()) {
            JavaServiceClass js = (JavaServiceClass)it.next();
            Iterator i = js.getPorts().iterator();
            while (i.hasNext()) {
                JavaPort jp = (JavaPort)i.next();
                String interfaceName = jp.getInterfaceClass();
                JavaInterface intf = interfaces.get(interfaceName);
                if (intf == null) {
                    interfaceName = jp.getPortType();
                    intf = interfaces.get(interfaceName);
                }
               
                String clientClassName = intf.getPackageName() + "." + interfaceName + "_"
                                         + NameUtil.mangleNameToClassName(jp.getPortName()) + "_Client";

                String serverClassName = intf.getPackageName() + "." + interfaceName + "_"
                                         + NameUtil.mangleNameToClassName(jp.getPortName()) + "_Server";
                String clientTargetName = interfaceName + "Client";
                boolean collison = false;
                if (clientClassNamesMap.keySet().contains(clientTargetName)) {
                    clientTargetName = clientTargetName + index;
                    collison = true;
View Full Code Here

        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
            String interfaceName = (String)iter.next();
            JavaInterface intf = interfaces.get(interfaceName);
           
            if (portIterator != null) {
                JavaPort jport = (JavaPort)portIterator.next();
                port = jport.getPortName();
            }

            clearAttributes();
            setAttributes("intf", intf);
View Full Code Here

        Iterator it = javaModel.getServiceClasses().values().iterator();
        while (it.hasNext()) {
            JavaServiceClass js = (JavaServiceClass)it.next();
            Iterator i = js.getPorts().iterator();
            while (i.hasNext()) {
                JavaPort jp = (JavaPort)i.next();
                String interfaceName = jp.getInterfaceClass();
                JavaInterface intf = interfaces.get(interfaceName);
                if (intf == null) {
                    interfaceName = jp.getPortType();
                    intf = interfaces.get(interfaceName);
                }
               
                String clientClassName = interfaceName + "_"
                                         + NameUtil.mangleNameToClassName(jp.getPortName()) + "_Client";

                clearAttributes();
                setAttributes("clientClassName", clientClassName);
                setAttributes("intf", intf);
                setAttributes("service", js);
View Full Code Here

        Iterator it = javaModel.getServiceClasses().values().iterator();
        while (it.hasNext()) {
            JavaServiceClass js = (JavaServiceClass)it.next();
            Iterator i = js.getPorts().iterator();
            while (i.hasNext()) {
                JavaPort jp = (JavaPort)i.next();
                String interfaceName = jp.getInterfaceClass();
                JavaInterface intf = interfaces.get(interfaceName);
                if (intf == null) {
                    interfaceName = jp.getPortType();
                    intf = interfaces.get(interfaceName);
                }
                address = StringUtils.isEmpty(jp.getBindingAdress()) ? address : jp.getBindingAdress();
                String serverClassName = interfaceName + "_"
                                         + NameUtil.mangleNameToClassName(jp.getPortName()) + "_Server";

                clearAttributes();
                setAttributes("serverClassName", serverClassName);
                setAttributes("intf", intf);
                if (penv.optionSet(ToolConstants.CFG_IMPL_CLASS)) {
View Full Code Here


        Collection<EndpointInfo> ports = service.getEndpoints();

        for (EndpointInfo port : ports) {
            JavaPort javaport = processPort(model, port);
            sclz.addPort(javaport);
        }
        model.addServiceClass(name, sclz);
    }
View Full Code Here

        }
        model.addServiceClass(name, sclz);
    }

    private JavaPort processPort(JavaModel model, EndpointInfo port) throws ToolException {
        JavaPort jport = new JavaPort(NameUtil.mangleNameToClassName(port.getName().getLocalPart()));
        jport.setPortName(port.getName().getLocalPart());
        BindingInfo binding = port.getBinding();
        jport.setBindingAdress(port.getAddress());
        jport.setBindingName(binding.getName().getLocalPart());

        String namespace = binding.getInterface().getName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));
        jport.setPackageName(packageName);

        InterfaceInfo infInfo = binding.getInterface();

        String portType = binding.getInterface().getName().getLocalPart();
        jport.setPortType(portType);

        JAXWSBinding infBinding = infInfo.getExtensor(JAXWSBinding.class);

        if (infBinding != null) {
            if (infBinding.getJaxwsClass() != null
                && !StringUtils.isEmpty(infBinding.getJaxwsClass().getClassName())) {
                jport.setPortType(infBinding.getJaxwsClass().getClassName());
            }

            if (!infBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(false);
            }
            if (!infBinding.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(false);
            }

            if (infBinding.getPackage() != null) {
                jaxwsBinding.setPackage(infBinding.getPackage());
            }
        }

        if (jaxwsBinding.getPackage() != null) {
            jport.setPackageName(jaxwsBinding.getPackage());
        }

        if (infBinding != null && infBinding.getJaxwsClass() != null
            && infBinding.getJaxwsClass().getClassName() != null) {
            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
            jport.setInterfaceClass(className);
        } else {
            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
        }

        bindingType = getBindingType(binding);

        if (bindingType == null) {
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message("BINDING_SPECIFY_ONE_PROTOCOL",
                                                       LOG,
                                                       binding.getName());
            throw new ToolException(msg);
        }

        if (isSoapBinding()) {
            SoapBinding spbd = SOAPBindingUtil.getProxy(SoapBinding.class, this.bindingObj);
            jport.setStyle(SOAPBindingUtil.getSoapStyle(spbd.getStyle()));
            jport.setTransURI(spbd.getTransportURI());
        }

        Collection<BindingOperationInfo> operations = binding.getOperations();
        for (BindingOperationInfo bop : operations) {
            processOperation(model, bop, binding);
View Full Code Here


        Collection<EndpointInfo> ports = service.getEndpoints();

        for (EndpointInfo port : ports) {
            JavaPort javaport = processPort(model, port);
            sclz.addPort(javaport);
        }
       
        sclz.setClassJavaDoc(jaxwsBinding.getClassJavaDoc());
        model.addServiceClass(name, sclz);
View Full Code Here

        sclz.setClassJavaDoc(jaxwsBinding.getClassJavaDoc());
        model.addServiceClass(name, sclz);
    }

    private JavaPort processPort(JavaModel model, EndpointInfo port) throws ToolException {
        JavaPort jport = new JavaPort(NameUtil.mangleNameToClassName(port.getName().getLocalPart()));
        jport.setPortName(port.getName().getLocalPart());
        BindingInfo binding = port.getBinding();
        jport.setBindingAdress(port.getAddress());
        jport.setBindingName(binding.getName().getLocalPart());

        String namespace = binding.getInterface().getName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));
        jport.setPackageName(packageName);

        InterfaceInfo infInfo = binding.getInterface();

        String portType = binding.getInterface().getName().getLocalPart();
        jport.setPortType(portType);

        JAXWSBinding infBinding = infInfo.getExtensor(JAXWSBinding.class);

        if (infBinding != null) {
            if (infBinding.getJaxwsClass() != null
                && !StringUtils.isEmpty(infBinding.getJaxwsClass().getClassName())) {
                jport.setPortType(infBinding.getJaxwsClass().getClassName());
                jaxwsBinding.setClassJavaDoc(infBinding.getJaxwsClass().getComments());
            }

            if (!infBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(false);
            }
            if (!infBinding.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(false);
            }

            if (infBinding.getPackage() != null) {
                jaxwsBinding.setPackage(infBinding.getPackage());
            }
           
            if (!infBinding.getPackageJavaDoc().equals("")) {
                jaxwsBinding.setPackageJavaDoc(infBinding.getPackageJavaDoc());
            }
        }

        if (jaxwsBinding.getPackage() != null) {
            jport.setPackageName(jaxwsBinding.getPackage());
        }

        if (infBinding != null && infBinding.getJaxwsClass() != null
            && infBinding.getJaxwsClass().getClassName() != null) {
            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
            jport.setInterfaceClass(className);
        } else {
            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
        }

        bindingType = getBindingType(binding);

        if (bindingType == null) {
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message("BINDING_SPECIFY_ONE_PROTOCOL",
                                                       LOG,
                                                       binding.getName());
            throw new ToolException(msg);
        }

        if (isSoapBinding()) {
            SoapBinding spbd = SOAPBindingUtil.getProxy(SoapBinding.class, this.bindingObj);
            jport.setStyle(SOAPBindingUtil.getSoapStyle(spbd.getStyle()));
            jport.setTransURI(spbd.getTransportURI());
        }

        Collection<BindingOperationInfo> operations = binding.getOperations();
        for (BindingOperationInfo bop : operations) {
            processOperation(model, bop, binding);
View Full Code Here

        }

        Collection<EndpointInfo> ports = service.getEndpoints();

        for (EndpointInfo port : ports) {
            JavaPort javaport = processPort(model, service, port);
            sclz.addPort(javaport);
        }
       
        sclz.setClassJavaDoc(jaxwsBinding.getClassJavaDoc());
        if (StringUtils.isEmpty(sclz.getClassJavaDoc())) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.common.model.JavaPort

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.