コード例 #1
0
ファイル: Subscriber.cs プロジェクト: AndreSilvs/SESDAD
        public void RegisterBrokers(List <string> addresses)
        {
            // Subscriber doesn't need to know the broker's name
            BrokerCircle brokerCircle = new BrokerCircle("");
            int          id           = 0;

            foreach (string address in addresses)
            {
                brokerCircle.AddBroker((IBroker)Activator.GetObject(typeof(IBroker), address), id);
                id++;
            }

            Subscriber.brokerCircle = brokerCircle;
        }
コード例 #2
0
ファイル: Broker.cs プロジェクト: AndreSilvs/SESDAD
        // Puppet Master
        public void RegisterChildReplication(List <string> addresses, string name)
        {
            BrokerCircle brokerCircle = new BrokerCircle(name);
            int          id           = 0;

            foreach (string address in addresses)
            {
                brokerCircle.AddBroker((IBroker)Activator.GetObject(typeof(IBroker), address), id);
                id++;
            }

            // Add circle to a list of neighbour circles
            Broker.neighbourBrokers.Add(brokerCircle);
        }
コード例 #3
0
ファイル: Broker.cs プロジェクト: AndreSilvs/SESDAD
        // Puppet Master
        public void RegisterChildReplication( List<string> addresses, string name )
        {
            BrokerCircle brokerCircle = new BrokerCircle( name );
            int id = 0;
            foreach ( string address in addresses ) {
                brokerCircle.AddBroker( (IBroker)Activator.GetObject( typeof( IBroker ), address ), id );
                id++;
            }

            // Add circle to a list of neighbour circles
            Broker.neighbourBrokers.Add( brokerCircle );
        }
コード例 #4
0
ファイル: Subscriber.cs プロジェクト: AndreSilvs/SESDAD
        public void RegisterBrokers( List<string> addresses )
        {
            // Subscriber doesn't need to know the broker's name
            BrokerCircle brokerCircle = new BrokerCircle( "" );
            int id = 0;
            foreach ( string address in addresses ) {
                brokerCircle.AddBroker( (IBroker)Activator.GetObject( typeof( IBroker ), address ), id );
                id++;
            }

            Subscriber.brokerCircle = brokerCircle;
        }