Package org.apache.cxf.jaxrs.provider

Examples of org.apache.cxf.jaxrs.provider.ProviderFactory$MessageBodyWriterComparator


       
        return null;
    }
   
    private Message createMessage() {
        ProviderFactory factory = ProviderFactory.getInstance();
        Message m = new MessageImpl();
        m.put("org.apache.cxf.http.case_insensitive_queries", false);
        Exchange e = new ExchangeImpl();
        m.setExchange(e);
        e.setInMessage(m);
View Full Code Here


        }
        if (body instanceof DOMSource) {
            return (Document)((DOMSource)body).getNode();
        }
       
        ProviderFactory pf = ProviderFactory.getInstance(m);
       
        Object providerObject = pf.createMessageBodyWriter(body.getClass(),
                                   body.getClass(), new Annotation[]{},
                                   MediaType.APPLICATION_XML_TYPE, m);
        if (!(providerObject instanceof JAXBElementProvider)) {
            return null;
        }
View Full Code Here

                                                  OperationResourceInfo ori,
                                                  Message m) throws IOException, WebApplicationException {
       
        List<MediaType> types = JAXRSUtils.intersectMimeTypes(ori.getConsumeTypes(), contentType);
       
        final ProviderFactory pf = ServerProviderFactory.getInstance(m);
        for (MediaType type : types) {
            List<ReaderInterceptor> readers = pf.createMessageBodyReaderInterceptor(
                                         targetTypeClass,
                                         parameterType,
                                         parameterAnnotations,
                                         type,
                                         m,
View Full Code Here

       
        return null;
    }
   
    private Message createMessage() {
        ProviderFactory factory = ProviderFactory.getInstance();
        Message m = new MessageImpl();
        m.put("org.apache.cxf.http.case_insensitive_queries", false);
        Exchange e = new ExchangeImpl();
        m.setExchange(e);
        e.setInMessage(m);
View Full Code Here

        // A little scope for some optimization exists, particularly,
        // it is feasible a complex object may need to be repeatedly converted
        // so we can keep a map of ParamConverter on the bus, that said
        // it seems an over-optimization at this stage, it's a 5% case;
        // typical requests have a limited number of simple URI parameters
        ProviderFactory pf = ProviderFactory.getInstance(cfg.getBus());
        if (pf != null) {
            @SuppressWarnings("unchecked")
            ParamConverter<Object> prov = (ParamConverter<Object>)pf.createParameterHandler(pClass);
            if (prov != null) {
                return prov.toString(pValue);
            }
        }
        return pValue.toString();
View Full Code Here

                                                  List<MediaType> consumeTypes,
                                                  Message m) throws IOException, WebApplicationException {
       
        List<MediaType> types = JAXRSUtils.intersectMimeTypes(consumeTypes, contentType);
       
        final ProviderFactory pf = ProviderFactory.getInstance(m);
        for (MediaType type : types) {
            List<ReaderInterceptor> readers = pf.createMessageBodyReaderInterceptor(
                                         targetTypeClass,
                                         parameterType,
                                         parameterAnnotations,
                                         type,
                                         m);
View Full Code Here

    public Object invoke(Exchange exchange, Object request, Object resourceObject) {

        final OperationResourceInfo ori = exchange.get(OperationResourceInfo.class);
        final ClassResourceInfo cri = ori.getClassResourceInfo();
        final Message inMessage = exchange.getInMessage();
        final ProviderFactory providerFactory = ProviderFactory.getInstance(inMessage);

        boolean wasSuspended = exchange.remove(REQUEST_WAS_SUSPENDED) != null;
       
        if (!wasSuspended) {
           
View Full Code Here

                ep.getService().setInvoker(createInvoker());
            } else {
                ep.getService().setInvoker(invoker);
            }
           
            ProviderFactory factory = setupFactory(ep);
           
            factory.setRequestPreprocessor(
                new RequestPreprocessor(languageMappings, extensionMappings));
            if (rc != null) {
                ep.put("org.apache.cxf.jaxrs.comparator", rc);
            }
           
View Full Code Here

            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
    }
   
    protected ProviderFactory setupFactory(Endpoint ep) {
        ProviderFactory factory = ProviderFactory.getInstance();
        if (entityProviders != null) {
            factory.setUserProviders(entityProviders);
        }
        if (getDataBinding() != null) {
            setDataBindingProvider(factory, ep.getService());
        }
        factory.setBus(getBus());
        if (schemaLocations != null) {
            factory.setSchemaLocations(schemaLocations);
        }
        ep.put(ProviderFactory.class.getName(), factory);
        return factory;
    }
View Full Code Here

           
        }
    }
   
    private static ResponseExceptionMapper<?> findExceptionMapper(Method m, Message message) {
        ProviderFactory pf = ProviderFactory.getInstance(message);
        for (Class<?> exType : m.getExceptionTypes()) {
            ResponseExceptionMapper<?> mapper = pf.createResponseExceptionMapper(exType);
            if (mapper != null) {
                return mapper;
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.provider.ProviderFactory$MessageBodyWriterComparator

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.