|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILnkMessageFactory
Message factory interface
From a link's perspective, a message is a higher level construct layered on top of packets (transport packaging units). Rather than always having packets dispatched up the link tree, it is possible for a user to register a message factory with the root endpoint. If so, when a packet is deserialized and ready for dispatch, the endpoint first queries the message factory as to whether the packet can and is to be converted to a message for dispatch. If so, the factory returns an opaque message object which then dispatched up the link tree.
There are two benefits of using message factories.
The first is when list dispatch is switched on. If an application uses messages rather than packets and it has requested for the packets to be dispatched as lists, then it is a performance penalty for the root endpoint to first prepare a list of packets and then the link user to walk through the list and convert to messages. Rather, when a message factory is registered with the root endpoint, the message list is created by the endpoint and dispatched. Any packet that is not convertible to a message automatically terminates the message list, triggers the dispatch of the list followed by the dispatch of the non-covertible packet and a new list created for subsequent packets.
The second benefit is that, for layered links, message list events traverse quicker through the tree since the intermediate nodes know from the event type that they don't need to process the event. In the case of packet and packet list events, the intermediate nodes typically have to process them for their control packets.
Method Summary | |
---|---|
ILnkMessage |
convert(PktPacket packet)
Invoked to convert a packet to a 'message' |
Method Detail |
---|
ILnkMessage convert(PktPacket packet)
packet
- The packet to convert to a message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |