Search in sources :

Example 6 with DeferredResult

use of org.springframework.web.context.request.async.DeferredResult in project spring-boot by spring-projects.

the class ErrorPageFilterTests method setUpAsyncDispatch.

private void setUpAsyncDispatch() throws Exception {
    this.request.setAsyncSupported(true);
    this.request.setAsyncStarted(true);
    DeferredResult<String> result = new DeferredResult<>();
    WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(this.request);
    asyncManager.setAsyncWebRequest(new StandardServletAsyncWebRequest(this.request, this.response));
    asyncManager.startDeferredResultProcessing(result);
}
Also used : WebAsyncManager(org.springframework.web.context.request.async.WebAsyncManager) StandardServletAsyncWebRequest(org.springframework.web.context.request.async.StandardServletAsyncWebRequest) DeferredResult(org.springframework.web.context.request.async.DeferredResult)

Aggregations

DeferredResult (org.springframework.web.context.request.async.DeferredResult)6 Test (org.junit.Test)2 MethodParameter (org.springframework.core.MethodParameter)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 Envelope (com.kixeye.chassis.transport.dto.Envelope)1 ServiceError (com.kixeye.chassis.transport.dto.ServiceError)1 WebSocketResponseConverter (com.kixeye.chassis.transport.websocket.responseconverter.WebSocketResponseConverter)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 Future (java.util.concurrent.Future)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 ServletRequest (javax.servlet.ServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 ResponseEntity (org.springframework.http.ResponseEntity)1 ServerHttpResponse (org.springframework.http.server.ServerHttpResponse)1 ServletServerHttpResponse (org.springframework.http.server.ServletServerHttpResponse)1 DeferredResultHandler (org.springframework.web.context.request.async.DeferredResult.DeferredResultHandler)1 StandardServletAsyncWebRequest (org.springframework.web.context.request.async.StandardServletAsyncWebRequest)1 WebAsyncManager (org.springframework.web.context.request.async.WebAsyncManager)1