public static Tuple <string, int, int> invokeBackEndDeploy(string arch_ref, string backend_address, string[] config)
        {
            //ServiceUtils.BackendServices.BackendServices backend_access = new ServiceUtils.BackendServices.BackendServices (backend_address);
            //backend_access.Timeout = int.MaxValue;

            //string platform_address = backend_access.deploy (config);

            // ACESSANDO O BACKEND DO CLUSTER DO LIA ...
            //ServiceUtils.LIABackendServices.BackEndService backend_access = new ServiceUtils.LIABackendServices.BackEndService (backend_address);
            //backend_access.Timeout = int.MaxValue;



            IBackendServices backend_access = (IBackendServices)Activator.CreateInstance(Type.GetType(backend_services [backend_address]), new string[1] {
                backend_address
            });

            string platform_address = backend_access.deploy(config[1]);

            Console.WriteLine("PLATFORM ADDRESS (" + arch_ref + "): " + platform_address);

            platform_address = platform_address.Replace("Platform.asmx", "PlatformServices.asmx");

            Thread.Sleep(5000);

            ServiceUtils.PlatformServices.PlatformServices platform_access = new ServiceUtils.PlatformServices.PlatformServices(platform_address);
            platform_access.Timeout = int.MaxValue;
            int base_binding_address = platform_access.getBaseBindingPort();

            platform_access.setPlatformRef(arch_ref);

            int nodes = platform_access.getNumberOfNodes();

            return(new Tuple <string, int, int> (platform_address, base_binding_address, nodes));
        }
        public static void invokeDeploySystem(SAFeSWL_Architecture arch_desc,
                                              string arch_ref,
                                              object platform_address,
                                              ComponentType c_appplication_abstract,
                                              ComponentType c_application_concrete,
                                              ComponentType c_workflow_abstract,
                                              ComponentType c_workflow_concrete,
                                              ComponentType c_system_abstract,
                                              ComponentType c_system_concrete)
        {
            try
            {
                IPlatformServices platform_access = null;
                if (platform_address is string)
                {
                    // Deploy the components of the system.
                    ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                    platform_access_.Timeout = int.MaxValue;
                    platform_access          = (IPlatformServices)platform_access_;
                }
                else if (platform_address is IPlatformServices)
                {
                    platform_access = (IPlatformServices)platform_address;
                }

                string application_abstract = LoaderApp.serialize <ComponentType>(c_appplication_abstract);
                string application_concrete = LoaderApp.serialize <ComponentType>(c_application_concrete);
                string workflow_abstract    = LoaderApp.serialize <ComponentType>(c_workflow_abstract);
                string workflow_concrete    = LoaderApp.serialize <ComponentType>(c_workflow_concrete);
                string system_abstract      = LoaderApp.serialize <ComponentType>(c_system_abstract);
                string system_concrete      = LoaderApp.serialize <ComponentType>(c_system_concrete);

                Console.Error.WriteLine(platform_access.deploy(application_abstract));
                Console.Error.WriteLine(platform_access.deploy(workflow_abstract));
                Console.Error.WriteLine(platform_access.deploy(system_abstract));

                Console.Error.WriteLine(platform_access.deploy(application_concrete));
                Console.Error.WriteLine(platform_access.deploy(workflow_concrete));
                Console.Error.WriteLine(platform_access.deploy(system_concrete));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
                Console.Error.WriteLine(e.StackTrace);
                if (e.InnerException != null)
                {
                    Console.Error.WriteLine(e.InnerException.Message);
                    Console.Error.WriteLine(e.InnerException.StackTrace);
                }
            }

            //return 0;
        }
        public static void invokeDeployComponent(object platform_address, string component)
        {
            IPlatformServices platform_access = null;

            if (platform_address is string)
            {
                // Deploy the components of the system.
                ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                platform_access_.Timeout = int.MaxValue;
                platform_access          = (IPlatformServices)platform_access_;
            }
            else if (platform_address is IPlatformServices)
            {
                platform_access = (IPlatformServices)platform_address;
            }

            platform_access.deploy(component);
        }
        public static void invokeDeployContracts(SAFeSWL_Architecture arch_desc,
                                                 string arch_ref,
                                                 IDictionary <string, Instantiator.ComponentFunctorApplicationType> contracts,
                                                 object platform_address)
        {
            br.ufc.pargo.hpe.backend.DGAC.database.Connector.openConnection();

            IPlatformServices platform_access = null;

            if (platform_address is string)
            {
                // Deploy the components of the system.
                ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                platform_access_.Timeout = int.MaxValue;
                platform_access          = (IPlatformServices)platform_access_;
            }
            else if (platform_address is IPlatformServices)
            {
                platform_access = (IPlatformServices)platform_address;
            }

            IDictionary <string, int[]> cs = LoaderSystem.componentsInPlatform(arch_desc, arch_ref);

            foreach (string c in cs.Keys)
            {
                if (contracts.ContainsKey(c))
                {
                    AbstractComponentFunctorApplication acfaRef = BackEnd.loadACFAFromInstantiator(contracts[c]);

                    string[] config_dependencies = calculateDependenciesOf(acfaRef.Id_functor_app);

                    foreach (string cRef in config_dependencies)
                    {
                        string config_filename = Constants.PATH_TEMP_WORKER + cRef + ".hpe";
                        string config_contents = File.ReadAllText(config_filename);

                        platform_access.deploy(config_contents);
                    }
                }
            }
            br.ufc.pargo.hpe.backend.DGAC.database.Connector.closeConnection();
        }