示例#1
0
        /// <summary>
        /// Opens the topology instance in client mode.
        /// </summary>
        /// <param name="router">The message router to be used by the cluster.</param>
        /// <param name="clusterEP">The cluster's logical endpoint.</param>
        /// <param name="args">Topology implementation specific parameters (ignored for this implementation).</param>
        /// <remarks>
        /// </remarks>
        public virtual void OpenClient(MsgRouter router, MsgEP clusterEP, ArgCollection args)
        {
            if (!clusterEP.IsLogical)
            {
                throw new ArgumentException(TopologyHelper.ClusterEPNotLogicalMsg);
            }

            if (!router.EnableP2P)
            {
                SysLog.LogWarning(NoP2PMsg);
            }

            this.router      = router;
            this.instanceID  = Helper.NewGuid();
            this.clusterEP   = clusterEP;
            this.broadcastEP = new MsgEP(clusterEP, "*");
            this.instanceEP  = null;
            this.isClient    = true;

            ArgCollection argsCopy;

            argsCopy = args.Clone();
            argsCopy["topology-type"] = TopologyHelper.SerializeType(this.GetType());
            serialized = argsCopy.ToString();

            OnLogicalChange();      // Forces the initial load of the instance EPs
        }
示例#2
0
        /// <summary>
        /// Opens the topology instance in client mode.
        /// </summary>
        /// <param name="router">The message router to be used by the cluster.</param>
        /// <param name="clusterEP">The cluster's logical endpoint.</param>
        /// <param name="args">Topology implementation specific parameters (ignored for this implementation).</param>
        /// <remarks>
        /// </remarks>
        public virtual void OpenClient(MsgRouter router, MsgEP clusterEP, ArgCollection args)
        {
            if (!clusterEP.IsLogical)
            {
                throw new ArgumentException(TopologyHelper.ClusterEPNotLogicalMsg);
            }

            this.router     = router;
            this.instanceID = Helper.NewGuid();
            this.clusterEP  = clusterEP;
            this.isClient   = true;

            ArgCollection argsCopy;

            argsCopy = args.Clone();
            argsCopy["topology-type"] = TopologyHelper.SerializeType(this.GetType());
            serialized = argsCopy.ToString();
        }