blob: b575a83d60c4d72d937d8bfb600e0654611645a9 [file] [log] [blame]
{ "type": "class",
"qname": "mx.messaging.ConsumerMessageDispatcher",
"baseClassname": ""
,
"description": "Helper class that listens for MessageEvents dispatched by ChannelSets that Consumers are subscribed over. This class is necessary because the server maintains queues of messages to push to this Flex client on a per-endpoint basis but the client may create more than one Channel that connects to a single server endpoint. In this scenario, messages can be pushed/polled to the client over a different channel instance than the one that the target Consumer subscribed over. The server isn't aware of this difference because both channels are pointed at the same endpoint. Here's a diagram to illustrate. Client: Consumer 1 Consumer 2 Consumer 3 | | / ChannelSet 1 ChannelSet 2 | | Channel 1 Channel 2 <- The endpoint URIs for these two channels are identical | | &#92;_______________________/ Server: | | Endpoint (that the two channels point to) | FlexClientOutboundQueue (for this endpoint for this FlexClient) &#92;-- Outbound messages for the three Consumer subscriptions When the endpoint receives a poll request from Channel 1 it will return queued messages for all three subscriptions but back on the client when Channel 1 dispatches message events for Consumer 2 and 3's subscriptions they won't see them because they're directly connected to the separate Channel2/ChannelSet2. This helper class keeps track of Consumer subscriptions and watches all ChannelSets for message events to ensure they're dispatched to the proper Consumer even when the client has been manually (miss)configured as the diagram illustrates. This class is a singleton that maintains a table of all subscribed Consumers and ref-counts the number of active subscriptions per ChannelSet to determine whether it needs to be listening for message events from a given ChannelSet or not; it dispatches message events from these ChannelSets to the proper Consumer instance by invoking the Consumer's messageHandler() method directly.",
"tags": [
{ "tagName": "private",
"values": []} ],
"members": [
{ "type": "method",
"qname": "getInstance",
"namespace": "public",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Returns the sole instance of this singleton class, creating it if it does not already exist.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["BlazeDS 4", "LCDS 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "mx.messaging.ConsumerMessageDispatcher",
"params": []}
,
{ "type": "method",
"qname": "mx.messaging.ConsumerMessageDispatcher",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor. Use getInstance() instead of &quot;new&quot; to create.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["BlazeDS 4", "LCDS 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": []}
,
{ "type": "method",
"qname": "isChannelUsedForSubscriptions",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Determines whether any subscriptions are using the specified channel.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["BlazeDS 4", "LCDS 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Boolean",
"params": [{ "name": "channel", "type": "mx.messaging.Channel"}]}
,
{ "type": "method",
"qname": "registerSubscription",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Registers a Consumer subscription. This will cause the ConsumerMessageDispatcher to start listening for MessageEvents from the underlying ChannelSet used to subscribe and redispatch messages to Consumers.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["BlazeDS 4", "LCDS 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "consumer", "type": "mx.messaging.AbstractConsumer"}]}
,
{ "type": "method",
"qname": "unregisterSubscription",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Unregisters a Consumer subscription. The ConsumerMessageDispatcher will stop monitoring underlying channels for messages for this Consumer.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["BlazeDS 4", "LCDS 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "consumer", "type": "mx.messaging.AbstractConsumer"}]}
]
}