Package io.grpc.servlet.jakarta.web
Class DelegatingAsyncContext
java.lang.Object
io.grpc.servlet.jakarta.web.DelegatingAsyncContext
- All Implemented Interfaces:
jakarta.servlet.AsyncContext
Util class to allow the complete() call to get some work done (writing trailers as a payload) before calling the
actual container implementation. The container will finish closing the stream before invoking the async listener and
formally informing the filter that the stream has closed, making this our last chance to intercept the closing of the
stream before it happens.
-
Field Summary
Fields inherited from interface jakarta.servlet.AsyncContext
ASYNC_CONTEXT_PATH, ASYNC_MAPPING, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(jakarta.servlet.AsyncListener listener) void
addListener
(jakarta.servlet.AsyncListener listener, jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) void
complete()
<T extends jakarta.servlet.AsyncListener>
TcreateListener
(Class<T> clazz) void
dispatch()
void
void
jakarta.servlet.ServletRequest
jakarta.servlet.ServletResponse
long
boolean
void
setTimeout
(long timeout) void
-
Constructor Details
-
DelegatingAsyncContext
public DelegatingAsyncContext(jakarta.servlet.AsyncContext delegate)
-
-
Method Details
-
getRequest
public jakarta.servlet.ServletRequest getRequest()- Specified by:
getRequest
in interfacejakarta.servlet.AsyncContext
-
getResponse
public jakarta.servlet.ServletResponse getResponse()- Specified by:
getResponse
in interfacejakarta.servlet.AsyncContext
-
hasOriginalRequestAndResponse
public boolean hasOriginalRequestAndResponse()- Specified by:
hasOriginalRequestAndResponse
in interfacejakarta.servlet.AsyncContext
-
dispatch
public void dispatch()- Specified by:
dispatch
in interfacejakarta.servlet.AsyncContext
-
dispatch
- Specified by:
dispatch
in interfacejakarta.servlet.AsyncContext
-
dispatch
- Specified by:
dispatch
in interfacejakarta.servlet.AsyncContext
-
complete
public void complete()- Specified by:
complete
in interfacejakarta.servlet.AsyncContext
-
start
- Specified by:
start
in interfacejakarta.servlet.AsyncContext
-
addListener
public void addListener(jakarta.servlet.AsyncListener listener) - Specified by:
addListener
in interfacejakarta.servlet.AsyncContext
-
addListener
public void addListener(jakarta.servlet.AsyncListener listener, jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) - Specified by:
addListener
in interfacejakarta.servlet.AsyncContext
-
createListener
public <T extends jakarta.servlet.AsyncListener> T createListener(Class<T> clazz) throws jakarta.servlet.ServletException - Specified by:
createListener
in interfacejakarta.servlet.AsyncContext
- Throws:
jakarta.servlet.ServletException
-
setTimeout
public void setTimeout(long timeout) - Specified by:
setTimeout
in interfacejakarta.servlet.AsyncContext
-
getTimeout
public long getTimeout()- Specified by:
getTimeout
in interfacejakarta.servlet.AsyncContext
-