Example #1
0
 internal MessageClient(string clientId, MessageDestination messageDestination, string endpointId, bool useSession)
 {
     SetIsValid(true);
     _clientId = clientId;
     Debug.Assert(messageDestination != null);
     _messageDestination = messageDestination;
     _endpointId         = endpointId;
     if (useSession)
     {
         _session = FluorineContext.Current.Session as Session;
         if (_session != null)
         {
             _session.RegisterMessageClient(this);
         }
         _client = FluorineContext.Current.Client;
         Debug.Assert(_client != null);
         _client.RegisterMessageClient(this);
     }
     else
     {
         _session = null;
         _client  = null;
     }
     if (log.IsDebugEnabled)
     {
         string msg = string.Format("MessageClient created with clientId {0} for destination {1}", _clientId, _messageDestination.Id);
         log.Debug(msg);
     }
 }
Example #2
0
 internal void Unsubscribe()
 {
     if (log.get_IsDebugEnabled())
     {
         log.Debug(__Res.GetString("MessageClient_Unsubscribe", new object[] { this.ClientId }));
     }
     if (this._messageClientDestroyedListeners != null)
     {
         foreach (IMessageClientListener listener in this._messageClientDestroyedListeners.Keys)
         {
             listener.MessageClientDestroyed(this);
         }
     }
     if (this._messageDestination != null)
     {
         this._messageDestination.RemoveSubscriber(this.ClientId);
     }
     this._client.UnregisterMessageClient(this);
     this._messageDestination = null;
 }
Example #3
0
 internal MessageClient(IClient client, SubscriptionManager subscriptionManager, string messageClientId, string endpoint, MessageDestination messageDestination)
 {
     this._client = client;
     this._subscriptionManager = subscriptionManager;
     this._messageClientId     = messageClientId;
     Debug.Assert(messageDestination != null);
     this._messageDestination = messageDestination;
     this._endpoint           = endpoint;
     this._connection         = FluorineContext.Current.Connection as IMessageConnection;
     if (this._connection != null)
     {
         this._connection.RegisterMessageClient(this);
     }
     if (_messageClientCreatedListeners != null)
     {
         foreach (IMessageClientListener listener in _messageClientCreatedListeners.Keys)
         {
             listener.MessageClientCreated(this);
         }
     }
 }
Example #4
0
 internal MessageClient(string clientId, MessageDestination destination, string endpointId)
     : this(clientId, destination, endpointId, true)
 {
 }
Example #5
0
        internal MessageClient(string clientId, MessageDestination messageDestination, string endpointId, bool useSession)
		{
            SetIsValid(true);
            _clientId = clientId;
            Debug.Assert(messageDestination != null);
            _messageDestination = messageDestination;
            _endpointId = endpointId;
            if (useSession)
            {
                _session = FluorineContext.Current.Session as Session;
                if (_session != null)
                    _session.RegisterMessageClient(this);
                _client = FluorineContext.Current.Client;
                Debug.Assert(_client != null);
                _client.RegisterMessageClient(this);
            }
            else
            {
                _session = null;
                _client = null;
            }
            if (log.IsDebugEnabled)
            {
                string msg = string.Format("MessageClient created with clientId {0} for destination {1}", _clientId, _messageDestination.Id);
                log.Debug(msg);
            }
		}
Example #6
0
 internal MessageClient(string clientId, MessageDestination destination, string endpointId)
     : this(clientId, destination, endpointId, true)
 {
 }
		public SubscriptionManager(MessageDestination messageDestination)
		{
			_messageDestination = messageDestination;
			_subscribers = new Hashtable();
		}