Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.HttpRequest


            logger.warn("Failed to parse request.", e);
            return;
         }

         HttpResponse theResponse = responseFactory.createResteasyHttpResponse(response);
         HttpRequest in = requestFactory.createResteasyHttpRequest(httpMethod, request, headers, uriInfo, theResponse, response);

         try
         {
            ResteasyProviderFactory.pushContext(HttpServletRequest.class, request);
            ResteasyProviderFactory.pushContext(HttpServletResponse.class, response);
View Full Code Here


      ResteasyRequestWrapper requestWrapper = RequestUtil.getRequestWrapper(
              request, request.getMethod(), prefix);
      try
      {
         // NOTE: if invoker isn't found, RESTEasy throw NoReourceFoundFailure
         HttpRequest httpRequest = requestWrapper.getHttpRequest();
         if (!httpRequest.isInitial())
         {
            String message = httpRequest.getUri().getPath() + " is not initial request.  Its suspended and retried.  Aborting.";
            logger.error(message);
            requestWrapper.setError(500, message);
         }
         else
         {
View Full Code Here

   public MultipartInputImpl(MediaType contentType, Providers workers)
   {
      this.contentType = contentType;
      this.workers = workers;
      HttpRequest httpRequest = ResteasyProviderFactory
              .getContextData(HttpRequest.class);
      if (httpRequest != null)
      {
         String defaultContentType = (String) httpRequest
                 .getAttribute(InputPart.DEFAULT_CONTENT_TYPE_PROPERTY);
         if (defaultContentType != null)
            this.defaultPartContentType = MediaType
                    .valueOf(defaultContentType);
      }
View Full Code Here

         SpringResourceFactory resourceFactory = resourceFactories.get(beanName);
         if (resourceFactory == null) return bean;

         PropertyInjector propertyInjector = resourceFactory.getPropertyInjector();

         HttpRequest request = ResteasyProviderFactory.getContextData(HttpRequest.class);
         if (isSingleton(beanName) || request == null)
         {
            propertyInjector.inject(bean);
         }
         else
View Full Code Here

      ResteasyWebHandlerTemplate template = new ResteasyWebHandlerTemplate<Void>(dispatcher.getProviderFactory())
      {
         protected Void handle(ResteasyRequestWrapper requestWrapper,
                               HttpResponse response) throws Exception
         {
            HttpRequest httpRequest = requestWrapper.getHttpRequest();
            dispatcher.pushContextObjects(httpRequest, response);
            try
            {
               try
               {
                  MediaType resolvedContentType = resolveContentType(httpRequest,
                          httpRequest.getHttpHeaders().getMediaType());
                  ServerResponse responseInvoker = getResponse(model, resolvedContentType);
                  if (responseInvoker != null)
                  {
                     responseInvoker.writeTo(httpRequest, response, dispatcher.getProviderFactory());
                  }
View Full Code Here

         boolean isRestfulData = RestfulData.class.isInstance(annotation);
         boolean isCookie = CookieParam.class.isInstance(annotation);
         if (!isRestfulData && !isCookie)
            continue;

         HttpRequest request = RequestUtil.getHttpRequest(servletRequest);
         Class type = methodParameter.getParameterType();
         Method method = methodParameter.getMethod();
         Type genericType = method.getGenericParameterTypes()[i];
         Annotation[] annotations = method.getParameterAnnotations()[i];

         if (isRestfulData)
         {
            method.getTypeParameters();
            String contentType = servletRequest.getContentType();
            MediaType mediaType = MediaType.valueOf(contentType);
            MessageBodyReader reader = factory.getMessageBodyReader(type,
                    genericType, annotations, mediaType);
            if (reader == null)
               throw new BadRequestException(
                       "Could not find message body reader for type: "
                               + genericType + " of content type: " + mediaType);
            return reader.readFrom(type, genericType, annotations, mediaType,
                    request.getHttpHeaders().getRequestHeaders(), request
                            .getInputStream());
         }
         else if (isCookie)
         {
            CookieParam cookieParam = (CookieParam) annotation;
View Full Code Here

         {
            throw new UnhandledException(e);
         }
         return null;
      }
      HttpRequest request = requestWrapper.getHttpRequest();
      if (dispatcher instanceof AsynchronousDispatcher)
      {
         AsynchronousDispatcher asyncDispatcher = (AsynchronousDispatcher) dispatcher;
         if (asyncDispatcher.isAsynchrnousRequest(request))
         {
View Full Code Here

   }

   protected ModelAndView createModelAndView(
           ResteasyRequestWrapper requestWrapper, HttpResponse response)
   {
      HttpRequest request = requestWrapper.getHttpRequest();
      dispatcher.pushContextObjects(request, response);
      try
      {
         ServerResponse jaxrsResponse = null;
         try
View Full Code Here

      if (propertyInjector == null)
      {
         propertyInjector = getPropertyInjector();
      }

      HttpRequest request = ResteasyProviderFactory.getContextData(HttpRequest.class);
      HttpResponse response = ResteasyProviderFactory.getContextData(HttpResponse.class);

      if ((request != null) && (response != null))
      {
         propertyInjector.inject(request, response, instance);
View Full Code Here

   private ResponseBuilderImpl builder;

   @Before
   public void before() throws URISyntaxException
   {
      HttpRequest httpRequest = MockHttpRequest.create("GET", REQUEST_URI,
              BASE_URI);

      ResteasyProviderFactory.getContextDataMap().put(HttpRequest.class,
              httpRequest);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.HttpRequest

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.