Class SizeLimitHandler.LimitInterceptor
java.lang.Object
org.eclipse.jetty.server.handler.SizeLimitHandler.LimitInterceptor
- All Implemented Interfaces:
HttpInput.Interceptor, HttpOutput.Interceptor
- Enclosing class:
SizeLimitHandler
private class SizeLimitHandler.LimitInterceptor
extends Object
implements HttpOutput.Interceptor, HttpInput.Interceptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HttpOutput.Interceptor(package private) long(package private) long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanreadFrom(HttpInput.Content content) voidReset the buffers.voidwrite(ByteBuffer content, boolean last, Callback callback) Write content.
-
Field Details
-
_nextOutput
-
_read
long _read -
_written
long _written
-
-
Constructor Details
-
LimitInterceptor
-
-
Method Details
-
getNextInterceptor
- Specified by:
getNextInterceptorin interfaceHttpOutput.Interceptor- Returns:
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()- Specified by:
isOptimizedForDirectBuffersin interfaceHttpOutput.Interceptor- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffers in theHttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)method. If false is returned, then passing direct buffers may cause inefficiencies.
-
readFrom
- Specified by:
readFromin interfaceHttpInput.Interceptor- Parameters:
content- The content to be intercepted (may be empty or aHttpInput.SentinelContent. The content will be modified with any data the interceptor consumes, but there is no requirement that all the data is consumed by the interceptor.- Returns:
- The intercepted content or null if interception is completed for that content.
-
write
Description copied from interface:HttpOutput.InterceptorWrite content. The response is committed by the first call to write and is closed by a call with last == true. Empty content buffers may be passed to force a commit or close.- Specified by:
writein interfaceHttpOutput.Interceptor- Parameters:
content- The content to be written or an empty buffer.last- True if this is the last call to writecallback- The callback to use to indicateCallback.succeeded()orCallback.failed(Throwable).
-
resetBuffer
public void resetBuffer()Description copied from interface:HttpOutput.InterceptorReset the buffers.If the Interceptor contains buffers then reset them.
- Specified by:
resetBufferin interfaceHttpOutput.Interceptor
-