Exemplo n.º 1
0
        /// <summary>
        /// @see IJobOperator#GetRunningExecutions .
        /// </summary>
        /// <param name="jobName"></param>
        /// <returns></returns>
        /// <exception cref="NoSuchJobException">&nbsp;</exception>
        public ICollection <long?> GetRunningExecutions(string jobName)
        {
            // SLE: OrderedSet is not a ISet: must return a Collection (Interface changed for that purpose)
            ICollection <long?> set = new OrderedSet <long?>();

            foreach (JobExecution jobExecution in JobExplorer.FindRunningJobExecutions(jobName))
            {
                set.Add(jobExecution.Id);
            }
            if (!set.Any() && !JobRegistry.GetJobNames().Contains(jobName))
            {
                throw new NoSuchJobException(string.Format("No such job (either in registry or in historical data): {0}", jobName));
            }
            return(set);
        }
Exemplo n.º 2
0
        static void GetPowerUnits(int count)
        {
            IEnumerable <Unit> range = unitsByPower.Take(count);

            result.Append("RESULT: ");

            foreach (var unit in range)
            {
                result.AppendFormat("{0}, ", unit);
            }

            if (unitsByPower.Any())
            {
                result.Remove(result.Length - 2, 2);
            }

            result.AppendLine();
        }
Exemplo n.º 3
0
 /// <summary>
 /// @see IJobOperator#GetRunningExecutions .
 /// </summary>
 /// <param name="jobName"></param>
 /// <returns></returns>
 /// <exception cref="NoSuchJobException">&nbsp;</exception>
 public ICollection<long?> GetRunningExecutions(string jobName)
 {
     // SLE: OrderedSet is not a ISet: must return a Collection (Interface changed for that purpose)
     ICollection<long?> set = new OrderedSet<long?>();
     foreach (JobExecution jobExecution in JobExplorer.FindRunningJobExecutions(jobName))
     {
         set.Add(jobExecution.Id);
     }
     if (!set.Any() && !JobRegistry.GetJobNames().Contains(jobName))
     {
         throw new NoSuchJobException(string.Format("No such job (either in registry or in historical data): {0}", jobName));
     }
     return set;
 }