The ChannelData object is used to transfer a message through the channel interceptor stack and eventually out on a transport to be sent to another node. While the message is being processed by the different interceptors, the message data can be manipulated as each interceptor seems appr
| 32 | * interceptors, the message data can be manipulated as each interceptor seems appropriate. |
| 33 | */ |
| 34 | public class ChannelData implements ChannelMessage { |
| 35 | @Serial |
| 36 | private static final long serialVersionUID = 1L; |
| 37 | |
| 38 | /** |
| 39 | * Empty array to avoid reinstantiating arrays. |
| 40 | */ |
| 41 | public static final ChannelData[] EMPTY_DATA_ARRAY = new ChannelData[0]; |
| 42 | |
| 43 | /** |
| 44 | * Flag to control whether secure random is used for UUID generation. |
| 45 | */ |
| 46 | public static volatile boolean USE_SECURE_RANDOM_FOR_UUID = false; |
| 47 | |
| 48 | /** |
| 49 | * The options this message was sent with |
| 50 | */ |
| 51 | private int options = 0; |
| 52 | /** |
| 53 | * The message data, stored in a dynamic buffer |
| 54 | */ |
| 55 | private XByteBuffer message; |
| 56 | /** |
| 57 | * The timestamp that goes with this message |
| 58 | */ |
| 59 | private long timestamp; |
| 60 | /** |
| 61 | * A unique message id |
| 62 | */ |
| 63 | private byte[] uniqueId; |
| 64 | /** |
| 65 | * The source or reply-to address for this message |
| 66 | */ |
| 67 | private Member address; |
| 68 | |
| 69 | /** |
| 70 | * Creates an empty channel data with a new unique Id |
| 71 | * |
| 72 | * @see #ChannelData(boolean) |
| 73 | */ |
| 74 | public ChannelData() { |
| 75 | this(true); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Create an empty channel data object |
| 80 | * |
| 81 | * @param generateUUID boolean - if true, a unique Id will be generated |
| 82 | */ |
| 83 | public ChannelData(boolean generateUUID) { |
| 84 | if (generateUUID) { |
| 85 | generateUUID(); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | |
| 90 | /** |
| 91 | * Creates a new channel data object with data |
nothing calls this directly
no outgoing calls
no test coverage detected