Пример #1
0
            public virtual Protocol createLayer(ProtocolStack prot_stack)
            {
                if (protocol_name == null)
                {
                    return(null);
                }



                Protocol protocol = null;

                switch (protocol_name)
                {
                case "TCP":
                    protocol = new Alachisoft.NGroups.Protocols.TCP();
                    break;

                case "TCPPING":
                    protocol = new Alachisoft.NGroups.Protocols.TCPPING();
                    break;

                case "QUEUE":
                    protocol = new Alachisoft.NGroups.Protocols.QUEUE();
                    break;

                case "TOTAL":
                    protocol = new Alachisoft.NGroups.Protocols.TOTAL();
                    break;

                case "VIEW_ENFORCER":
                    protocol = new Alachisoft.NGroups.Protocols.VIEW_ENFORCER();
                    break;

                case "pbcast.GMS":
                    protocol = new Alachisoft.NGroups.Protocols.pbcast.GMS();
                    break;
                }

                if (protocol != null)
                {
                    prot_stack.NCacheLog.Info("Configurator.createLayer()", "Created Layer " + protocol.GetType().FullName);
                    protocol.Stack = prot_stack;
                    if (properties != null)
                    {
                        if (!protocol.setPropertiesInternal(properties))
                        {
                            return(null);
                        }
                    }
                    protocol.init();
                }
                else
                {
                    prot_stack.NCacheLog.Error("Configurator.createLayer()", "Couldn't create layer: " + protocol_name);
                }

                return(protocol);
            }
Пример #2
0
			public virtual Protocol createLayer(ProtocolStack prot_stack)
			{
				if (protocol_name == null)
					return null;
			
              

                Protocol protocol = null;

                switch (protocol_name)
                {
                    case "TCP":
                        protocol = new Alachisoft.NGroups.Protocols.TCP();
                        break;
                    case "TCPPING":
                        protocol = new Alachisoft.NGroups.Protocols.TCPPING();
                        break;
                    case "QUEUE":
                        protocol = new Alachisoft.NGroups.Protocols.QUEUE();
                        break;
                    case "TOTAL":
                        protocol = new Alachisoft.NGroups.Protocols.TOTAL();
                        break;
                    case "VIEW_ENFORCER":
                        protocol = new Alachisoft.NGroups.Protocols.VIEW_ENFORCER();
                        break;
                    case "pbcast.GMS":
                        protocol = new Alachisoft.NGroups.Protocols.pbcast.GMS();
                        break;                    
                }

                if (protocol != null)
				{
                    prot_stack.NCacheLog.Info("Configurator.createLayer()",  "Created Layer " + protocol.GetType().FullName);
                    protocol.Stack = prot_stack;
					if (properties != null)
                        if (!protocol.setPropertiesInternal(properties))
							return null;
                    protocol.init();
				}
				else
				{
                    prot_stack.NCacheLog.Error("Configurator.createLayer()",  "Couldn't create layer: " + protocol_name);
				}

                return protocol;
			}