Package org.apache.cxf.service

Examples of org.apache.cxf.service.Service


    protected boolean isRequestor(Message message) {
        return Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE));
    }
    protected boolean supportsDataReader(Message message, Class<?> input) {
        Service service = ServiceModelUtil.getService(message.getExchange());
        Class<?> cls[] = service.getDataBinding().getSupportedReaderFormats();
        for (Class<?> c : cls) {
            if (c.equals(input)) {
                return true;
            }
        }
View Full Code Here


            }
        }
        return false;
    }
    protected <T> DataReader<T> getDataReader(Message message, Class<T> input) {
        Service service = ServiceModelUtil.getService(message.getExchange());
        DataReader<T> dataReader = service.getDataBinding().createReader(input);
        if (dataReader == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER",
                                                                   BUNDLE, service.getName()));
        }
        dataReader.setAttachments(message.getAttachments());
        dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().getEndpoint());
        dataReader.setProperty(Message.class.getName(), message);
        setDataReaderValidation(service, message, dataReader);
View Full Code Here

        bean.setServiceClass(RPCLitGreeterImpl.class);
        RPCLitGreeterImpl greeter = new RPCLitGreeterImpl();
        BeanInvoker invoker = new BeanInvoker(greeter);
        bean.setInvoker(invoker);

        Service service = bean.create();
       
        EndpointInfo endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPortRPCLit"));
        Endpoint endpoint = new EndpointImpl(getBus(), service, endpointInfo);
        exchange.put(Service.class, service);
        exchange.put(Endpoint.class, endpoint);
    }
View Full Code Here

    public ClientImpl(Bus bus, URL wsdlUrl, QName service,
                      QName port, EndpointImplFactory endpointImplFactory) {
        this.bus = bus;
        outFaultObserver = new ClientOutFaultObserver(bus);

        Service svc = service == null
            ? bus.getExtension(WSDLServiceFactory.class).create(wsdlUrl)
                : bus.getExtension(WSDLServiceFactory.class).create(wsdlUrl, service);
        EndpointInfo epfo = findEndpoint(svc, port);

        try {
View Full Code Here

        bean.setServiceClass(CalculatorImpl.class);
        CalculatorImpl calculator = new CalculatorImpl();
        BeanInvoker invoker = new BeanInvoker(calculator);
        bean.setInvoker(invoker);

        Service service = bean.create();
       
        EndpointInfo endpointInfo = service.getEndpointInfo(new QName(ns, "CalculatorPort"));
        Endpoint endpoint = new EndpointImpl(getBus(), service, endpointInfo);
        exchange.put(Service.class, service);
        exchange.put(Endpoint.class, endpoint);       
    }
View Full Code Here

    }

    public void handleMessage(final Message message) {
        final Exchange exchange = message.getExchange();
        final Endpoint endpoint = exchange.get(Endpoint.class);
        final Service service = endpoint.getService();
        final Invoker invoker = service.getInvoker();       

        Runnable invocation = new Runnable() {

            public void run() {
                Exchange runableEx = message.getExchange();
View Full Code Here

    protected void writeParts(Message message, Exchange exchange,
                              BindingOperationInfo operation, MessageContentsList objs,
                              List<MessagePartInfo> parts) {
        OutputStream out = message.getContent(OutputStream.class);
        XMLStreamWriter origXmlWriter = message.getContent(XMLStreamWriter.class);
        Service service = exchange.getService();
        XMLStreamWriter xmlWriter = origXmlWriter;
        CachingXmlEventWriter cache = null;
       
        // configure endpoint and operation level schema validation
        setOperationSchemaValidation(operation.getOperationInfo(), message);
View Full Code Here

        if (bop != null && !StaxUtils.toNextElement(xmlReader)) {
            // body may be empty for partial response to decoupled request
            return;
        }

        Service service = ServiceModelUtil.getService(message.getExchange());
        bop = getBindingOperationInfo(xmlReader, exchange, bop, client);
        boolean forceDocLitBare = false;
        if (bop != null && bop.getBinding() != null) {
            forceDocLitBare = Boolean.TRUE.equals(bop.getBinding().getService().getProperty("soap.force.doclit.bare"));
        }
View Full Code Here

            return new JAXRSInvoker(serviceBeans);          
        }
    }

    protected Endpoint createEndpoint() throws BusException, EndpointException {
        Service service = serviceFactory.getService();

        if (service == null) {
            service = serviceFactory.create();
        }
View Full Code Here

       
        if (endpointName != null) {
            serviceFactory.setEndpointName(endpointName);   
        }
       
        Service service = serviceFactory.getService();
       
        if (service == null) {
            initializeServiceFactory();
            service = serviceFactory.create();
        }
       
        if (endpointName == null) {
            endpointName = serviceFactory.getEndpointName();
        }
        EndpointInfo ei = service.getEndpointInfo(endpointName);
       
        if (ei != null) {
            if (transportId != null
                && !ei.getTransportId().equals(transportId)) {
                ei = null;
            } else {
                BindingFactoryManager bfm = getBus().getExtension(BindingFactoryManager.class);
                bindingFactory = bfm.getBindingFactory(ei.getBinding().getBindingId());
            }
        }
       
        if (ei == null) {
            if (getAddress() == null) {
                ei = ServiceModelUtil.findBestEndpointInfo(serviceFactory.getInterfaceName(), service
                    .getServiceInfos());
            }
            if (ei == null && !serviceFactory.isPopulateFromClass()) {
                ei = ServiceModelUtil.findBestEndpointInfo(serviceFactory.getInterfaceName(), service
                                                           .getServiceInfos());
                if (ei != null
                    && transportId != null
                    && !ei.getTransportId().equals(transportId)) {
                    ei = null;
                }
                if (ei != null) {
                    BindingFactoryManager bfm = getBus().getExtension(BindingFactoryManager.class);
                    bindingFactory = bfm.getBindingFactory(ei.getBinding().getBindingId());
                }

                if (ei == null) {
                    LOG.warning("Could not find endpoint/port for "
                                + endpointName + " in wsdl. Creating default.");
                } else {
                    LOG.warning("Could not find endpoint/port for "
                                + endpointName + " in wsdl. Using "
                                + ei.getName() + ".");                       
                }
            }
            if (ei == null) {
                ei = createEndpointInfo();
            } else if (getAddress() != null) {
                ei.setAddress(getAddress());
                if (ei.getAddress().startsWith("camel")
                        || ei.getAddress().startsWith("local")) {
                    modifyTransportIdPerAddress(ei);
                }
               
            }
        } else if (getAddress() != null) {
            ei.setAddress(getAddress());
        }

        if (endpointReference != null) {
            ei.setAddress(endpointReference);
        }
        Endpoint ep = service.getEndpoints().get(ei.getName());
       
        if (ep == null) {
            ep = serviceFactory.createEndpoint(ei);
            ((EndpointImpl)ep).initializeActiveFeatures(getFeatures());
        } else {
            serviceFactory.setEndpointName(ei.getName());
            if (ep.getActiveFeatures() == null) {
                ((EndpointImpl)ep).initializeActiveFeatures(getFeatures());
            }
        }
       
        if (properties != null) {
            ep.putAll(properties);
        }
       
        service.getEndpoints().put(ep.getEndpointInfo().getName(), ep);
       
        if (getInInterceptors() != null) {
            ep.getInInterceptors().addAll(getInInterceptors());
        }
        if (getOutInterceptors() != null) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.Service

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.