Package com.yahoo.messagebus.test
Class SimpleMessage
- java.lang.Object
-
- com.yahoo.messagebus.Routable
-
- com.yahoo.messagebus.Message
-
- com.yahoo.messagebus.test.SimpleMessage
-
public class SimpleMessage extends Message
- Author:
- Haavard Pettersen
-
-
Constructor Summary
Constructors Constructor Description SimpleMessage(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getApproxSize()
Obtain the approximate size of this message object in bytes.com.yahoo.text.Utf8String
getProtocol()
Return the name of the protocol that defines this routable.int
getType()
Returns the type of this routable.java.lang.String
getValue()
void
setValue(java.lang.String value)
-
Methods inherited from class com.yahoo.messagebus.Message
getBucketSequence, getRetry, getRetryEnabled, getRoute, getSequenceId, getTimeReceived, getTimeRemaining, getTimeRemainingNow, hasBucketSequence, hasSequenceId, isExpired, setRetry, setRetryEnabled, setRoute, setTimeReceived, setTimeReceivedNow, setTimeRemaining, swapState
-
Methods inherited from class com.yahoo.messagebus.Routable
discard, getCallStack, getContext, getTrace, popHandler, pushHandler, setContext
-
-
-
-
Method Detail
-
getType
public int getType()
Description copied from class:Routable
Returns the type of this routable. The id '0' is reserved for the EmptyReply class. Other ids must be defined by the application protocol.
-
getProtocol
public com.yahoo.text.Utf8String getProtocol()
Description copied from class:Routable
Return the name of the protocol that defines this routable. This must be implemented by all inheriting classes, and should then return the result ofProtocol.getName()
of its protocol.- Specified by:
getProtocol
in classRoutable
- Returns:
- the name of the protocol defining this message.
-
getApproxSize
public int getApproxSize()
Description copied from class:Message
Obtain the approximate size of this message object in bytes. This enables messagebus to track the size of the send queue in both memory usage and item count. This method returns 1 by default, and must be overridden to enable message size tracking.
- Overrides:
getApproxSize
in classMessage
- Returns:
- 1
-
getValue
public java.lang.String getValue()
-
setValue
public void setValue(java.lang.String value)
-
-