RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

org.jboss.resteasy.plugins.server
Class BaseHttpRequest

java.lang.Object
  extended by org.jboss.resteasy.plugins.server.BaseHttpRequest
All Implemented Interfaces:
HttpRequest

public abstract class BaseHttpRequest
extends Object
implements HttpRequest

Helper for creating HttpRequest implementations. The async code is a fake implementation to work with http engines that don't support async HTTP.

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  AbstractAsynchronousResponse asynchronousResponse
           
protected  javax.ws.rs.core.MultivaluedMap<String,String> decodedFormParameters
           
protected  SynchronousDispatcher dispatcher
           
protected  javax.ws.rs.core.MultivaluedMap<String,String> formParameters
           
protected  HttpResponse httpResponse
           
protected  CountDownLatch latch
           
protected  boolean suspended
           
protected  long suspendTimeout
           
 
Constructor Summary
BaseHttpRequest(SynchronousDispatcher dispatcher)
           
 
Method Summary
 AsynchronousResponse createAsynchronousResponse(long suspendTimeout)
          This method will create an asynchronous response and prepare the request to be issued asynchronously
 AsynchronousResponse getAsynchronousResponse()
          Returns the AsynchronousResponse created by createAsynchronousResponse
 javax.ws.rs.core.MultivaluedMap<String,String> getDecodedFormParameters()
           
 javax.ws.rs.core.MultivaluedMap<String,String> getFormParameters()
          application/x-www-form-urlencoded parameters

This is here because @FormParam needs it and for when there are servlet filters that eat up the input stream

 void initialRequestThreadFinished()
          Callback by the initial calling thread.
 boolean isInitial()
          Asynchronous HTTP support.
 boolean isSuspended()
          Asynchronous HTTP support.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.resteasy.spi.HttpRequest
getAttribute, getHttpHeaders, getHttpMethod, getInputStream, getPreprocessedPath, getUri, removeAttribute, setAttribute, setInputStream, setPreprocessedPath
 

Field Detail

latch

protected CountDownLatch latch

suspendTimeout

protected long suspendTimeout

dispatcher

protected SynchronousDispatcher dispatcher

suspended

protected boolean suspended

formParameters

protected javax.ws.rs.core.MultivaluedMap<String,String> formParameters

decodedFormParameters

protected javax.ws.rs.core.MultivaluedMap<String,String> decodedFormParameters

asynchronousResponse

protected AbstractAsynchronousResponse asynchronousResponse

httpResponse

protected HttpResponse httpResponse
Constructor Detail

BaseHttpRequest

public BaseHttpRequest(SynchronousDispatcher dispatcher)
Method Detail

getFormParameters

public javax.ws.rs.core.MultivaluedMap<String,String> getFormParameters()
Description copied from interface: HttpRequest
application/x-www-form-urlencoded parameters

This is here because @FormParam needs it and for when there are servlet filters that eat up the input stream

Specified by:
getFormParameters in interface HttpRequest
Returns:
null if no parameters, this is encoded map

getDecodedFormParameters

public javax.ws.rs.core.MultivaluedMap<String,String> getDecodedFormParameters()
Specified by:
getDecodedFormParameters in interface HttpRequest

createAsynchronousResponse

public AsynchronousResponse createAsynchronousResponse(long suspendTimeout)
Description copied from interface: HttpRequest
This method will create an asynchronous response and prepare the request to be issued asynchronously

Specified by:
createAsynchronousResponse in interface HttpRequest
Returns:

getAsynchronousResponse

public AsynchronousResponse getAsynchronousResponse()
Description copied from interface: HttpRequest
Returns the AsynchronousResponse created by createAsynchronousResponse

Specified by:
getAsynchronousResponse in interface HttpRequest
Returns:

isInitial

public boolean isInitial()
Description copied from interface: HttpRequest
Asynchronous HTTP support. Mirrors Servlet 3.0 API

Specified by:
isInitial in interface HttpRequest

isSuspended

public boolean isSuspended()
Description copied from interface: HttpRequest
Asynchronous HTTP support. Mirrors Servlet 3.0 API

Specified by:
isSuspended in interface HttpRequest

initialRequestThreadFinished

public void initialRequestThreadFinished()
Description copied from interface: HttpRequest
Callback by the initial calling thread. This callback will probably do nothing in an asynchronous environment but will be used to simulate AsynchronousResponse in vanilla Servlet containers that do not support asychronous HTTP.

Specified by:
initialRequestThreadFinished in interface HttpRequest

RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.