Package org.apache.cxf.jaxrs.ext

Examples of org.apache.cxf.jaxrs.ext.MessageContextImpl


        public Message getMessage() {
            return m;
        }
       
        protected MessageContext getContext() {
            return new MessageContextImpl(m);
        };
View Full Code Here


                                           Class<?> pClass, Type genericType,
                                           Annotation[] paramAnns,
                                           String defaultValue,
                                           boolean decode) {
       
        MessageContext mc = new MessageContextImpl(m);
        MediaType mt = mc.getHttpHeaders().getMediaType();
       
        @SuppressWarnings("unchecked")
        MultivaluedMap<String, String> params =
            (MultivaluedMap<String, String>)m.get(FormUtils.FORM_PARAM_MAP);
       
View Full Code Here

        } else if (Providers.class.isAssignableFrom(clazz)) {
            o = new ProvidersImpl(contextMessage);
        } else if (ContextResolver.class.isAssignableFrom(clazz)) {
            o = createContextResolver(genericType, contextMessage);
        } else if (MessageContext.class.isAssignableFrom(clazz)) {
            o = new MessageContextImpl(m);
        } else if (SearchContext.class.isAssignableFrom(clazz)) {
            o = new SearchContextImpl(m);
        } else if (Application.class.isAssignableFrom(clazz)) {
            ProviderInfo<?> providerInfo =
                (ProviderInfo)contextMessage.getExchange().getEndpoint().get(Application.class.getName());
View Full Code Here

        m.setExchange(exc);
        m.put(Message.RESPONSE_CODE, "200");
       
        MessageBodyReader<Response> reader = new ResponseReader(Book.class) {
            protected MessageContext getContext() {
                return new MessageContextImpl(m);
            }
        };
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Response r = reader.readFrom(Response.class, Response.class,
            new Annotation[0], MediaType.TEXT_XML_TYPE, headers, is);
View Full Code Here

        } else if (MessageBodyWorkers.class.isAssignableFrom(clazz)) {
            o = new ProvidersImpl(m);
        } else if (ContextResolver.class.isAssignableFrom(clazz)) {
            o = createContextResolver(genericType, m);
        } else if (MessageContext.class.isAssignableFrom(clazz)) {
            o = new MessageContextImpl(m);
        }
       
        o = o == null ? createServletResourceValue(m, clazz) : o;
        return clazz.cast(o);
    }
View Full Code Here

        } else if (MessageBodyWorkers.class.isAssignableFrom(clazz)) {
            o = new ProvidersImpl(contextMessage);
        } else if (ContextResolver.class.isAssignableFrom(clazz)) {
            o = createContextResolver(genericType, contextMessage);
        } else if (MessageContext.class.isAssignableFrom(clazz)) {
            o = new MessageContextImpl(m);
        }
       
        o = o == null ? createServletResourceValue(contextMessage, clazz) : o;
        return clazz.cast(o);
    }
View Full Code Here

               
                String contextCookie = createCookie(SSOConstants.RELAY_STATE,
                                                    info.getRelayState(),
                                                    info.getWebAppContext(),
                                                    info.getWebAppDomain());
                new MessageContextImpl(m).getHttpServletResponse().addHeader(
                    HttpHeaders.SET_COOKIE, contextCookie);
               
                return Response.ok(info)
                               .type("text/html")
                               .header(HttpHeaders.CACHE_CONTROL, "no-cache, no-store")
View Full Code Here

   
    @Test
    public void testWrite() throws Exception {
        XSLTJaxbProvider<Book> provider = new XSLTJaxbProvider<Book>();
        provider.setOutTemplate(TEMPLATE_LOCATION);
        provider.setMessageContext(new MessageContextImpl(createMessage()));
        Book b = new Book();
        b.setId(123L);
        b.setName("TheBook");
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        provider.writeTo(b, Book.class, Book.class, b.getClass().getAnnotations(),
View Full Code Here

            protected XMLStreamWriter getStreamWriter(Object obj, OutputStream os, MediaType mt) {
                return StaxUtils.createXMLStreamWriter(os);
            }
        };
        provider.setOutTemplate(TEMPLATE_LOCATION);
        provider.setMessageContext(new MessageContextImpl(createMessage()));
        Book b = new Book();
        b.setId(123L);
        b.setName("TheBook");
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        provider.writeTo(b, Book.class, Book.class, b.getClass().getAnnotations(),
View Full Code Here

        public Message getMessage() {
            return m;
        }
       
        protected MessageContext getContext() {
            return new MessageContextImpl(m);
        };
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.ext.MessageContextImpl

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.