Package org.apache.tika.server.core
Class ResponseWriteDeadlineInterceptor
java.lang.Object
org.apache.tika.server.core.ResponseWriteDeadlineInterceptor
- All Implemented Interfaces:
jakarta.ws.rs.ext.WriterInterceptor
@Provider
public class ResponseWriteDeadlineInterceptor
extends Object
implements jakarta.ws.rs.ext.WriterInterceptor
Aborts a response still being written
maxResponseWriteMillis after it is committed;
the idle timeout alone resets on every trickle a slow reader accepts.
A timer, not a check between writes: one blocking write to a client that accepts a byte at a time can otherwise outlast the deadline indefinitely. From commit, not the first write: CXF drains the unread request body inside that write, which the read deadline bounds. Aborted, not closed: closing would end a chunked body cleanly, passing a truncated document off as complete.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDistinct type so its mapper, not the catch-all, handles it.static final classEntity-less: the connection is gone, so CXF has nothing to write; the timer already logged it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaroundWriteTo(jakarta.ws.rs.ext.WriterInterceptorContext context)
-
Constructor Details
-
ResponseWriteDeadlineInterceptor
public ResponseWriteDeadlineInterceptor(long maxResponseWriteMillis) - Parameters:
maxResponseWriteMillis- how long writing a response body may take; negative disables it
-
-
Method Details
-
aroundWriteTo
- Specified by:
aroundWriteToin interfacejakarta.ws.rs.ext.WriterInterceptor- Throws:
IOException
-