Package io.undertow.io
Class BlockingReceiverImpl
java.lang.Object
io.undertow.io.BlockingReceiverImpl
- All Implemented Interfaces:
Receiver
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.undertow.io.Receiver
Receiver.ErrorCallback, Receiver.FullBytesCallback, Receiver.FullStringCallback, Receiver.PartialBytesCallback, Receiver.PartialStringCallback, Receiver.RequestToLargeException -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpause()When receiving partial data calling this method will pause the callbacks.voidreceiveFullBytes(Receiver.FullBytesCallback callback) Reads the request and invokes the callback when the request body has been fully read.voidreceiveFullBytes(Receiver.FullBytesCallback callback, Receiver.ErrorCallback errorCallback) Reads the request and invokes the callback when the request body has been fully read.voidreceiveFullString(Receiver.FullStringCallback callback) Reads the request and invokes the callback when the request body has been fully read.voidreceiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback) Reads the request and invokes the callback when the request body has been fully read.voidreceiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset) Reads the request and invokes the callback when the request body has been fully read.voidreceiveFullString(Receiver.FullStringCallback callback, Charset charset) Reads the request and invokes the callback when the request body has been fully read.voidReads the request and invokes the callback with request data.voidreceivePartialBytes(Receiver.PartialBytesCallback callback, Receiver.ErrorCallback errorCallback) Reads the request and invokes the callback with request data.voidReads the request and invokes the callback with request data.voidreceivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback) Reads the request and invokes the callback with request data.voidreceivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset) Reads the request and invokes the callback with request data.voidreceivePartialString(Receiver.PartialStringCallback callback, Charset charset) Reads the request and invokes the callback with request data.voidresume()Resumes paused callbacks.voidsetMaxBufferSize(int maxBufferSize) Sets the maximum amount of data that will be buffered in memory.
-
Field Details
-
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAY
-
-
Constructor Details
-
BlockingReceiverImpl
-
-
Method Details
-
setMaxBufferSize
public void setMaxBufferSize(int maxBufferSize) Description copied from interface:ReceiverSets the maximum amount of data that will be buffered in memory. If you call a receiveFull* method and the request size is larger than this amount then the error callback with be invoked with aRequestTooBigException.- Specified by:
setMaxBufferSizein interfaceReceiver- Parameters:
maxBufferSize- The maximum amount of data to be buffered
-
receiveFullString
public void receiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback) Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. This string will be interpreted according toStandardCharsets.ISO_8859_1. If there is an error reading the request the error callback will be invoked.- Specified by:
receiveFullStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on error
-
receiveFullString
Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. This string will be interpreted according toStandardCharsets.ISO_8859_1. If there is an error the exchange will be ended.- Specified by:
receiveFullStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the request
-
receivePartialString
public void receivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback) Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according toStandardCharsets.ISO_8859_1. If there is an error reading the request the error callback will be invoked.- Specified by:
receivePartialStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on error
-
receivePartialString
Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according toStandardCharsets.ISO_8859_1. If there is an error the exchange will be ended.- Specified by:
receivePartialStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the request
-
receiveFullString
public void receiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset) Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.- Specified by:
receiveFullStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on errorcharset- The charset that is used to interpret the string
-
receiveFullString
Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.- Specified by:
receiveFullStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requestcharset- The charset that is used to interpret the string
-
receivePartialString
public void receivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset) Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.- Specified by:
receivePartialStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on errorcharset- The charset that is used to interpret the string
-
receivePartialString
Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.- Specified by:
receivePartialStringin interfaceReceiver- Parameters:
callback- The callback to invoke with the requestcharset- The charset that is used to interpret the string
-
receiveFullBytes
public void receiveFullBytes(Receiver.FullBytesCallback callback, Receiver.ErrorCallback errorCallback) Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. If there is an error reading the request the error callback will be invoked.- Specified by:
receiveFullBytesin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on error
-
receiveFullBytes
Description copied from interface:ReceiverReads the request and invokes the callback when the request body has been fully read. If there is an error the exchange will be ended.- Specified by:
receiveFullBytesin interfaceReceiver- Parameters:
callback- The callback to invoke with the request
-
receivePartialBytes
public void receivePartialBytes(Receiver.PartialBytesCallback callback, Receiver.ErrorCallback errorCallback) Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error reading the request the error callback will be invoked.- Specified by:
receivePartialBytesin interfaceReceiver- Parameters:
callback- The callback to invoke with the requesterrorCallback- The callback that is invoked on error
-
receivePartialBytes
Description copied from interface:ReceiverReads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error the exchange will be ended.- Specified by:
receivePartialBytesin interfaceReceiver- Parameters:
callback- The callback to invoke with the request
-
pause
public void pause()Description copied from interface:ReceiverWhen receiving partial data calling this method will pause the callbacks. Callbacks will not resume untilReceiver.resume()has been called. -
resume
public void resume()Description copied from interface:ReceiverResumes paused callbacks.
-