예제 #1
0
        /// <summary>
        /// Builds and returns a property string understood by the lower layer, i.e., Cluster
        /// Uses the properties specified in the configuration, and defaults for others.
        /// </summary>
        /// <param name="properties">cluster properties</param>
        /// <returns>property string used by Cluster</returns>
        public static string GetClusterPropertyString(IDictionary properties, long opTimeout)
        {
            bool udpCluster = true;

            // check if a reference to some scheme is specified
            string cacheScheme = SafeGet(properties, "class").ToLower();

            if (cacheScheme == "tcp")
            {
                udpCluster = false;
            }

            if (!properties.Contains("channel"))
            {
                throw new ConfigurationException("Cannot find channel properties");
            }

            IDictionary channelprops = properties["channel"] as IDictionary;

            if (udpCluster)
            {
                return(ChannelConfigBuilder.BuildUDPConfiguration(channelprops));
            }
            return(ChannelConfigBuilder.BuildTCPConfiguration(channelprops, opTimeout));
        }
예제 #2
0
        public static string GetClusterPropertyString(IDictionary properties, long opTimeout, bool isPor)
        {
            bool udpCluster = true;

            // check if a reference to some scheme is specified
            udpCluster = false;
            if (!properties.Contains("channel"))
            {
                throw new ConfigurationException("Cannot find channel properties");
            }

            IDictionary channelprops = properties["channel"] as IDictionary;

            if (udpCluster)
            {
                return(ChannelConfigBuilder.BuildUDPConfiguration(channelprops));
            }
            return(ChannelConfigBuilder.BuildTCPConfiguration(channelprops, opTimeout, isPor));
        }