Package com.rabbitmq.client.impl.nio
Class DefaultByteBufferFactory
- java.lang.Object
-
- com.rabbitmq.client.impl.nio.DefaultByteBufferFactory
-
- All Implemented Interfaces:
ByteBufferFactory
public class DefaultByteBufferFactory extends java.lang.Object implements ByteBufferFactory
DefaultByteBufferFactorythat creates heap-basedByteBuffers. This behavior can be changed by passing in a customFunctionto the constructor.- Since:
- 5.5.0
- See Also:
NioParams,ByteBufferFactory
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<java.lang.Integer,java.nio.ByteBuffer>allocator
-
Constructor Summary
Constructors Constructor Description DefaultByteBufferFactory()DefaultByteBufferFactory(java.util.function.Function<java.lang.Integer,java.nio.ByteBuffer> allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.nio.ByteBuffercreateEncryptedByteBuffer(NioContext nioContext)java.nio.ByteBuffercreateEncryptedReadBuffer(NioContext nioContext)Create the network readByteBuffer.java.nio.ByteBuffercreateEncryptedWriteBuffer(NioContext nioContext)Create the network writeByteBuffer.java.nio.ByteBuffercreateReadBuffer(NioContext nioContext)Create theByteBufferthat contains inbound frames.java.nio.ByteBuffercreateWriteBuffer(NioContext nioContext)Create theByteBufferthat contains outbound frames.
-
-
-
Method Detail
-
createReadBuffer
public java.nio.ByteBuffer createReadBuffer(NioContext nioContext)
Description copied from interface:ByteBufferFactoryCreate theByteBufferthat contains inbound frames. This buffer is the network buffer for plain connections. When using SSL/TLS, this buffer isn't directly connected to the network, the encrypted read buffer is.- Specified by:
createReadBufferin interfaceByteBufferFactory- Returns:
-
createWriteBuffer
public java.nio.ByteBuffer createWriteBuffer(NioContext nioContext)
Description copied from interface:ByteBufferFactoryCreate theByteBufferthat contains outbound frames. This buffer is the network buffer for plain connections. When using SSL/TLS, this buffer isn't directed connected to the network, the encrypted write buffer is.- Specified by:
createWriteBufferin interfaceByteBufferFactory- Returns:
-
createEncryptedReadBuffer
public java.nio.ByteBuffer createEncryptedReadBuffer(NioContext nioContext)
Description copied from interface:ByteBufferFactoryCreate the network readByteBuffer. This buffer contains encrypted frames read from the network. TheSSLEnginedecrypts frame and pass them over to the read buffer.- Specified by:
createEncryptedReadBufferin interfaceByteBufferFactory- Returns:
-
createEncryptedWriteBuffer
public java.nio.ByteBuffer createEncryptedWriteBuffer(NioContext nioContext)
Description copied from interface:ByteBufferFactoryCreate the network writeByteBuffer. This buffer contains encrypted outbound frames. These frames come from the write buffer that sends them through theSSLContextfor encryption to this buffer.- Specified by:
createEncryptedWriteBufferin interfaceByteBufferFactory- Returns:
-
createEncryptedByteBuffer
protected java.nio.ByteBuffer createEncryptedByteBuffer(NioContext nioContext)
-
-