gov.va.medora.mdo.dao.MultiSourceQuery.execute C# (CSharp) Method

execute() public method

public execute ( String daoName, String methodName, Object args ) : IndexedHashtable
daoName String
methodName String
args Object
return IndexedHashtable
        public IndexedHashtable execute(String daoName, String methodName, Object[] args)
        {
            int lth = cxnTable.Count;
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
                {
                    continue;
                }
                Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName);
                queries[i] = new QueryThread(dao, methodName, args);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(cxnTable.Count);
            for (int i=0; i<threads.Length; i++)
            {
                if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
                {
                    result.Add((string)cxnTable.GetKey(i),(Exception)cxnTable.GetValue(i));
                    continue;
                }
                try
                {
                    threads[i].Join();
                    result.Add((String)cxnTable.GetKey(i), queries[i].Result);
                }
                catch (Exception)
                {
                    //throw new MdoException(e);
                }
            }
            return result;
        }

Usage Example

Beispiel #1
0
 public IndexedHashtable getTimestamp(MultiSourceQuery msq)
 {
     return msq.execute("Connection", "getTimestamp", new object[] { });
 }