Esempio n. 1
0
        public gov.cca.ComponentID getComponentID(string componentInstanceName)
        {
            ManagerObject manager = backend.DGAC.BackEnd.connectToManager(out ch);

            gov.cca.ComponentID cid = manager.getComponentID(componentInstanceName);

            backend.DGAC.BackEnd.releaseManager(ch);

            return(cid);
        }
        void Services.releasePort(string portName)
        {
            //	Console.WriteLine ("RELEASE PORT 1.0 " + portName + "/" + mkPortName(portName) + " --- " + cid.getInstanceName());
            ComponentID cid_inner = frw.getComponentID(mkPortName(portName));

            //	Console.WriteLine ("RELEASE PORT 1.1 " + portName +  " --- " + (cid_inner == null ? "NULL" : cid_inner.getInstanceName()));
            if (!(cid_inner is ManagerIgnoredComponentID))
            {
                int[] nodes = cid.WorkerNodes;
                //for (int i=0; i<nodes.Length; i++)
                foreach (int i in WorkerServices.Keys)
                {
                    //		Console.WriteLine ("RELEASE PORT 2 - i=" + i + " - nodes[i]=" + nodes[i]  /*+ " - " + WorkerServices.Length + " - " + nodes.Length*/);
                    gov.cca.Services ws = WorkerServices[i];
                    ws.releasePort(portName);
                }
            }
            //	Console.WriteLine ("RELEASE PORT 4 " + portName);
            frw.releasePort(mkPortName(portName));
            //	Console.WriteLine ("RELEASE PORT 5 " + portName);
        }
Esempio n. 3
0
        void Services.releasePort(string portName)
        {
            //	Console.WriteLine ("RELEASE PORT 1.0 " + portName + "/" + mkPortName(portName) + " --- " + cid.getInstanceName());
            ComponentID cid_inner = frw.getComponentID(mkPortName(portName));

            //	Console.WriteLine ("RELEASE PORT 1.1 " + portName +  " --- " + (cid_inner == null ? "NULL" : cid_inner.getInstanceName()));
            if (!(cid_inner is ManagerIgnoredComponentID))
            {
                //		Console.WriteLine ("RELEASE PORT 2 - ");
                gov.cca.Services ws = WorkerServices;
                try {
                    ws.releasePort(portName);
                }
                catch (Exception e)
                {
                    //		Console.WriteLine ("RELEASE PORT 3");
                    //if (e.getCCAExceptionType () != CCAExceptionType.PortNotDefined)
                    //	throw e;
                }
            }
            //	Console.WriteLine ("RELEASE PORT 4 " + portName);
            frw.releasePort(mkPortName(portName));
            //	Console.WriteLine ("RELEASE PORT 5 " + portName);
        }