The Concept of a Channel Manager


Channel managers share a common abstract base type: System.ServiceModel.Channels. ChannelManagerBase. The name of this type does not reflect its purpose. From the name, one might assume that the ChannelManagerBase type is a means to keep track of the channels that a channel factory or channel listener creates. In early incarnations of WCF (at that time, called Indigo), this was indeed the case. This early design tightly coupled the lifetime and state of a channel to the lifetime and state of the object that created it. For example, when a channel manager closed, it would then close all of the channels it created.

This model is workable on the sender, but less than ideal on the receiver, since a receiver can have only one channel listener stack per Uniform Resource Identifier (URI). Receivers frequently need to create new channel listener stacks and shut down the state of the existing listener stacks. Because closing a receiving channel can trigger substantial work (for example, WS-RM messages, committing or aborting transactions, and so on), shutting down the channel listener that created it can take a long time. If there is no coupling between a channel listener and the channels it creates, it is possible to shut down the current listener, let the existing work complete, and start a new channel listener to process new messages. This model is the one adopted by the team in the first version product, primarily because it enables better throughput on receiving applications.

In essence, the early concept of a channel manager is still valid on the sender. Instead of doing channel management work in the ChannelManagerBase type, however, channel factories manage the channels they create further down in their type hierarchy. As a result of these changes, the ChannelManagerBase type is simply a means to force channel factories and channel listeners to implement the state machine, implement the query mechanism, and pass timeouts from a Binding to the channels they create.




Inside Windows Communication Foundation
Inside Windows Communication Foundation (Pro Developer)
ISBN: 0735623066
EAN: 2147483647
Year: 2007
Pages: 106
Authors: Justin Smith

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net