//
        public void startDistributedOpeartion(String approach)
        {
            // TODO Auto-generated method stub
            // call all the nodes to start operation (CME).
            NetworkBean      data            = new NetworkBean();
            ServerOperations serveroperation = new ServerOperations();



            foreach (KeyValuePair <string, string> entries in data.getpId_Address())
            {
                String sendAddress = entries.Value;
                String sendiD      = entries.Key;
                try
                {
                    strtDistributedOperations proxy = XmlRpcProxyGen.Create <strtDistributedOperations>();
                    proxy.Url = sendAddress;
                    proxy.startDistributedOperations(approach);
                }


                catch (Exception e)
                {
                    // TODO Auto-generated catch block
                    //   removeNode(sendiD);
                    //  data.getpId_Address().Remove(sendiD);
                    //  if (sendiD.Equals(data.getMasterPid()))
                    // { bullyAlgorithm(); }
                    //   Console.WriteLine(e.StackTrace);
                }
            }



            if (approach.Equals("CME"))
            {
                AutomatedDistributedOperation ADO = new AutomatedDistributedOperation();
                Thread thread = new Thread(() => ADO.startDistributedCME());
                thread.Start();
                data.setStartCME(true);
            }
            if (approach.Equals("RA"))
            {
                AutomatedDistributedOperation ADO = new AutomatedDistributedOperation();
                Thread thread = new Thread(() => ADO.startDistributedRicartAndAgarwala());
                thread.Start();
                data.setStartRicartAgarwala(true);
            }
        }
Ejemplo n.º 2
0
        public Boolean startDistributedOperations(String approach)
        {
            NetworkBean data = new NetworkBean();

            if (approach.Equals("CME"))
            {
                AutomatedDistributedOperation ADO = new AutomatedDistributedOperation();
                Thread thread = new Thread(() => ADO.startDistributedCME());
                thread.Start();
                data.setStartCME(true);
            }
            if (approach.Equals("RA"))
            {
                AutomatedDistributedOperation ADO = new AutomatedDistributedOperation();
                Thread thread = new Thread(() => ADO.startDistributedRicartAndAgarwala());
                thread.Start();

                data.setStartRicartAgarwala(true);
                //data.setStartRicartAgarwala(true);
            }
            return(true);
        }