Package io.aeron.command
Class TerminateDriverFlyweight
java.lang.Object
io.aeron.command.CorrelatedMessageFlyweight
io.aeron.command.TerminateDriverFlyweight
Command message flyweight to ask the driver process to terminate.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Client ID | | | +---------------------------------------------------------------+ | Correlation ID | | | +---------------------------------------------------------------+ | Token Length | +---------------------------------------------------------------+ | Token Buffer ... ... | +---------------------------------------------------------------+
- See Also:
-
Field Summary
Fields inherited from class io.aeron.command.CorrelatedMessageFlyweight
LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeLength(int tokenLength) Compute the length of the command message for a given token length.intlength()Get the length of the current message.tokenBuffer(DirectBuffer tokenBuffer, int tokenOffset, int tokenLength) Fill the token buffer.intLength of the token buffer in bytes.intRelative offset of the token buffer.voidvalidateLength(int msgTypeId, int length) Validate buffer length is long enough for message.wrap(MutableDirectBuffer buffer, int offset) Wrap the buffer at a given offset for updates.Methods inherited from class io.aeron.command.CorrelatedMessageFlyweight
clientId, clientId, correlationId, correlationId
-
Constructor Details
-
TerminateDriverFlyweight
public TerminateDriverFlyweight()
-
-
Method Details
-
wrap
Wrap the buffer at a given offset for updates.- Overrides:
wrapin classCorrelatedMessageFlyweight- Parameters:
buffer- to wrap.offset- at which the message begins.- Returns:
- this for a fluent API.
-
tokenBufferOffset
public int tokenBufferOffset()Relative offset of the token buffer.- Returns:
- relative offset of the token buffer.
-
tokenBufferLength
public int tokenBufferLength()Length of the token buffer in bytes.- Returns:
- length of token buffer in bytes.
-
tokenBuffer
public TerminateDriverFlyweight tokenBuffer(DirectBuffer tokenBuffer, int tokenOffset, int tokenLength) Fill the token buffer.- Parameters:
tokenBuffer- containing the optional token for the request.tokenOffset- within the tokenBuffer at which the token begins.tokenLength- of the token in the tokenBuffer.- Returns:
- this for a fluent API.
-
length
public int length()Get the length of the current message.NB: must be called after the data is written in order to be correct.
- Returns:
- the length of the current message
-
validateLength
public void validateLength(int msgTypeId, int length) Validate buffer length is long enough for message.- Overrides:
validateLengthin classCorrelatedMessageFlyweight- Parameters:
msgTypeId- type of message.length- of message in bytes to validate.
-
computeLength
public static int computeLength(int tokenLength) Compute the length of the command message for a given token length.- Parameters:
tokenLength- to be appended to the header.- Returns:
- the length of the command message for a given token length.
-