コード例 #1
0
 internal DestinationSettings(FluorineFx.Messaging.Config.ServiceSettings serviceSettings, string id, AdapterSettings adapter, string source)
 {
     this._serviceSettings = serviceSettings;
     this._properties      = new Hashtable();
     this._channels        = new ChannelSettingsCollection();
     this._id      = id;
     this._adapter = adapter;
     this._properties["source"] = source;
 }
コード例 #2
0
 internal void SetAdapterSettings(FluorineFx.Messaging.Config.AdapterSettings value)
 {
     this._adapterSettings = value;
 }
コード例 #3
0
 public void Remove(AdapterSettings value)
 {
     this._adapterDictionary.Remove(value.Id);
     base.List.Remove(value);
 }
コード例 #4
0
 public void Insert(int index, AdapterSettings value)
 {
     this._adapterDictionary[value.Id] = value;
     base.List.Insert(index, value);
 }
コード例 #5
0
 public int IndexOf(AdapterSettings value)
 {
     return(base.List.IndexOf(value));
 }
コード例 #6
0
 public bool Contains(AdapterSettings value)
 {
     return(base.List.Contains(value));
 }
コード例 #7
0
 public int Add(AdapterSettings value)
 {
     this._adapterDictionary[value.Id] = value;
     return(base.List.Add(value));
 }
コード例 #8
0
        internal DestinationSettings(FluorineFx.Messaging.Config.ServiceSettings serviceSettings, XmlNode destinationNode)
        {
            this._serviceSettings = serviceSettings;
            this._properties      = new Hashtable();
            this._channels        = new ChannelSettingsCollection();
            this._id = destinationNode.Attributes["id"].Value;
            XmlNode node = destinationNode.SelectSingleNode("adapter");

            if (node != null)
            {
                string          str      = node.Attributes["ref"].Value;
                AdapterSettings settings = serviceSettings.AdapterSettings[str];
                this._adapter = settings;
            }
            this._propertiesNode = destinationNode.SelectSingleNode("properties");
            if (this._propertiesNode != null)
            {
                XmlNode node2 = this._propertiesNode.SelectSingleNode("source");
                if (node2 != null)
                {
                    this._properties["source"] = node2.InnerXml;
                }
                XmlNode node3 = this._propertiesNode.SelectSingleNode("factory");
                if (node3 != null)
                {
                    this._properties["factory"] = node3.InnerXml;
                }
                XmlNode node4 = this._propertiesNode.SelectSingleNode("attribute-id");
                if (node4 != null)
                {
                    this._properties["attribute-id"] = node4.InnerXml;
                }
                else
                {
                    this._properties["attribute-id"] = this._id;
                }
                XmlNode node5 = this._propertiesNode.SelectSingleNode("scope");
                if (node5 != null)
                {
                    this._properties["scope"] = node5.InnerXml;
                }
                XmlNode networkDefinitionNode = this._propertiesNode.SelectSingleNode("network");
                if (networkDefinitionNode != null)
                {
                    FluorineFx.Messaging.Config.NetworkSettings settings2 = new FluorineFx.Messaging.Config.NetworkSettings(networkDefinitionNode);
                    this._network = settings2;
                }
                XmlNode metadataDefinitionNode = this._propertiesNode.SelectSingleNode("metadata");
                if (metadataDefinitionNode != null)
                {
                    FluorineFx.Messaging.Config.MetadataSettings settings3 = new FluorineFx.Messaging.Config.MetadataSettings(metadataDefinitionNode);
                    this._metadata = settings3;
                }
                XmlNode severDefinitionNode = this._propertiesNode.SelectSingleNode("server");
                if (severDefinitionNode != null)
                {
                    FluorineFx.Messaging.Config.ServerSettings settings4 = new FluorineFx.Messaging.Config.ServerSettings(severDefinitionNode);
                    this._server = settings4;
                }
                XmlNode msmqDefinitionNode = this._propertiesNode.SelectSingleNode("msmq");
                if (msmqDefinitionNode != null)
                {
                    FluorineFx.Messaging.Config.MsmqSettings settings5 = new FluorineFx.Messaging.Config.MsmqSettings(msmqDefinitionNode);
                    this._msmqSettings = settings5;
                }
            }
            XmlNode securityNode = destinationNode.SelectSingleNode("security");

            if (securityNode != null)
            {
                FluorineFx.Messaging.Config.SecuritySettings settings6 = new FluorineFx.Messaging.Config.SecuritySettings(this, securityNode);
                this._security = settings6;
            }
            else
            {
                this._security = new FluorineFx.Messaging.Config.SecuritySettings(this);
            }
            XmlNode node11 = destinationNode.SelectSingleNode("channels");

            if (node11 != null)
            {
                XmlNodeList list = node11.SelectNodes("channel");
                foreach (XmlNode node12 in list)
                {
                    ChannelSettings settings7;
                    string          str2 = node12.Attributes["ref"].Value;
                    if (str2 != null)
                    {
                        settings7 = this._serviceSettings.ServiceConfigSettings.ChannelsSettings[str2];
                        this._channels.Add(settings7);
                    }
                    else
                    {
                        settings7 = new ChannelSettings(node12);
                        this._channels.Add(settings7);
                    }
                }
            }
        }
コード例 #9
0
        public static ServiceConfigSettings Load(string configPath, string configFileName)
        {
            ChannelSettings settings2;

            FluorineFx.Messaging.Config.ServiceSettings settings4;
            AdapterSettings settings5;

            FluorineFx.Messaging.Config.SecuritySettings settings6;
            string path = Path.Combine(configPath, configFileName);
            ServiceConfigSettings serviceConfigSettings = new ServiceConfigSettings();

            if (File.Exists(path))
            {
                log.Debug(__Res.GetString("MessageServer_LoadingConfig", new object[] { path }));
                XmlDocument document = new XmlDocument();
                document.Load(path);
                XmlNodeList list = document.SelectNodes("/services-config/channels/channel-definition");
                foreach (XmlNode node in list)
                {
                    XmlNode node2 = node.SelectSingleNode("endpoint");
                    string  str2  = node2.Attributes["class"].Value;
                    string  str3  = node2.Attributes["uri"].Value;
                    settings2 = new ChannelSettings(node);
                    serviceConfigSettings.ChannelsSettings.Add(settings2);
                }
                XmlNodeList list2 = document.SelectNodes("/services-config/factories/factory");
                foreach (XmlNode node3 in list2)
                {
                    string          str4      = node3.Attributes["id"].Value;
                    string          str5      = node3.Attributes["class"].Value;
                    FactorySettings settings3 = new FactorySettings(node3);
                    serviceConfigSettings.FactoriesSettings.Add(settings3);
                }
                XmlNodeList list3 = document.SelectNodes("/services-config/services/service-include");
                foreach (XmlNode node4 in list3)
                {
                    string str6 = node4.Attributes["file-path"].Value;
                    str6 = Path.Combine(configPath, str6);
                    log.Debug(__Res.GetString("MessageServer_LoadingServiceConfig", new object[] { str6 }));
                    settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings);
                    settings4.Init(str6);
                    if ((settings4.Id == "remoting-service") && (settings4.DefaultAdapter == null))
                    {
                        settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, false);
                        settings4.AdapterSettings.Add(settings5);
                    }
                    serviceConfigSettings.ServiceSettings.Add(settings4);
                }
                XmlNodeList list4 = document.SelectNodes("/services-config/services/service");
                foreach (XmlNode node5 in list4)
                {
                    settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings);
                    settings4.Init(node5);
                    if ((settings4.Id == "remoting-service") && (settings4.DefaultAdapter == null))
                    {
                        settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, false);
                        settings4.AdapterSettings.Add(settings5);
                    }
                    serviceConfigSettings.ServiceSettings.Add(settings4);
                }
                XmlNode securityNode = document.SelectSingleNode("/services-config/security");
                if (securityNode != null)
                {
                    settings6 = new FluorineFx.Messaging.Config.SecuritySettings(null, securityNode);
                    serviceConfigSettings._securitySettings = settings6;
                }
                XmlNode flexClientNode = document.SelectSingleNode("/services-config/flex-client");
                if (flexClientNode != null)
                {
                    FluorineFx.Messaging.Config.FlexClientSettings settings7 = new FluorineFx.Messaging.Config.FlexClientSettings(flexClientNode);
                    serviceConfigSettings._flexClientSettings = settings7;
                    return(serviceConfigSettings);
                }
                serviceConfigSettings._flexClientSettings = new FluorineFx.Messaging.Config.FlexClientSettings();
                return(serviceConfigSettings);
            }
            log.Debug(__Res.GetString("MessageServer_LoadingConfigDefault", new object[] { path }));
            LoginCommandCollection loginCommands = FluorineConfiguration.Instance.LoginCommands;

            if (loginCommands != null)
            {
                settings6 = new FluorineFx.Messaging.Config.SecuritySettings(null);
                LoginCommandSettings item = new LoginCommandSettings {
                    Server = "asp.net",
                    Type   = loginCommands.GetLoginCommand("asp.net")
                };
                settings6.LoginCommands.Add(item);
                serviceConfigSettings._securitySettings = settings6;
            }
            settings2 = new ChannelSettings("my-amf", "flex.messaging.endpoints.AMFEndpoint", "http://{server.name}:{server.port}/{context.root}/Gateway.aspx");
            serviceConfigSettings.ChannelsSettings.Add(settings2);
            settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings, "remoting-service", typeof(RemotingService).FullName);
            string customClass = "flex.messaging.messages.RemotingMessage";
            string type        = FluorineConfiguration.Instance.ClassMappings.GetType(customClass);

            settings4.SupportedMessageTypes[customClass] = type;
            serviceConfigSettings.ServiceSettings.Add(settings4);
            settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, true);
            settings4.DefaultAdapter = settings5;
            DestinationSettings settings9 = new DestinationSettings(settings4, "fluorine", settings5, "*");

            settings4.DestinationSettings.Add(settings9);
            serviceConfigSettings._flexClientSettings = new FluorineFx.Messaging.Config.FlexClientSettings();
            return(serviceConfigSettings);
        }