Package io.hekate.messaging.intercept
Interface ServerReceiveContext<T>
-
- Type Parameters:
T
- Message type.
- All Superinterfaces:
ServerInboundContext<T>
public interface ServerReceiveContext<T> extends ServerInboundContext<T>
Server's receive context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
overrideMessage(T msg)
Overrides the received message with the specified one.Optional<MessageMetaData>
readMetaData()
Reads the message's meta-data.Object
setAttribute(String name, Object value)
Sets an attribute of this context.-
Methods inherited from interface io.hekate.messaging.intercept.ServerInboundContext
channelName, from, getAttribute, payload, type
-
-
-
-
Method Detail
-
readMetaData
Optional<MessageMetaData> readMetaData()
Reads the message's meta-data.- Returns:
- Message's meta-data.
-
overrideMessage
void overrideMessage(T msg)
Overrides the received message with the specified one.- Parameters:
msg
- New message that should replace the received one.
-
setAttribute
Object setAttribute(String name, Object value)
Sets an attribute of this context.Attributes are local to this context object and do not get transferred to a remote peer.
- Parameters:
name
- Name.value
- Value.- Returns:
- Previous value or
null
if attribute didn't have any value. - See Also:
ServerInboundContext.getAttribute(String)
-
-