コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleExecutor"/> class.
        /// </summary>
        /// <param name="executors">The collection of vertex processors.</param>
        /// <param name="conditions">The collection of execution conditions.</param>
        /// <param name="schedule">The schedule that should be executed.</param>
        /// <param name="id">The ID of the schedule that is being executed.</param>
        /// <param name="executionInfo">The object that stores information about the current running schedule.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="executors"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="conditions"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="CannotExecuteScheduleWithoutProcessorsException">
        ///     Thrown if <paramref name="executors"/> is an empty collection.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="schedule"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="id"/> is <see langword="null" />.
        /// </exception>
        public ScheduleExecutor(
            IEnumerable <IProcesExecutableScheduleVertices> executors,
            IStoreScheduleConditions conditions,
            ISchedule schedule,
            ScheduleId id,
            ScheduleExecutionInfo executionInfo = null)
        {
            {
                Lokad.Enforce.Argument(() => executors);
                Lokad.Enforce.With <CannotExecuteScheduleWithoutProcessorsException>(
                    executors.Any(),
                    Resources.Exceptions_Messages_CannotExecuteScheduleWithoutProcessors);

                Lokad.Enforce.Argument(() => conditions);
                Lokad.Enforce.Argument(() => schedule);
                Lokad.Enforce.Argument(() => id);
            }

            m_Executors     = executors.ToDictionary(v => v.VertexTypeToProcess, v => v);
            m_Conditions    = conditions;
            m_Schedule      = schedule;
            m_ScheduleId    = id;
            m_ExecutionInfo = new ScheduleExecutionInfo(executionInfo);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleExecutor"/> class.
        /// </summary>
        /// <param name="executors">The collection of vertex processors.</param>
        /// <param name="conditions">The collection of execution conditions.</param>
        /// <param name="schedule">The schedule that should be executed.</param>
        /// <param name="id">The ID of the schedule that is being executed.</param>
        /// <param name="executionInfo">The object that stores information about the current running schedule.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="executors"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="conditions"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="CannotExecuteScheduleWithoutProcessorsException">
        ///     Thrown if <paramref name="executors"/> is an empty collection.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="schedule"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="id"/> is <see langword="null" />.
        /// </exception>
        public ScheduleExecutor(
            IEnumerable<IProcesExecutableScheduleVertices> executors,
            IStoreScheduleConditions conditions,
            ISchedule schedule,
            ScheduleId id,
            ScheduleExecutionInfo executionInfo = null)
        {
            {
                Lokad.Enforce.Argument(() => executors);
                Lokad.Enforce.With<CannotExecuteScheduleWithoutProcessorsException>(
                    executors.Any(),
                    Resources.Exceptions_Messages_CannotExecuteScheduleWithoutProcessors);

                Lokad.Enforce.Argument(() => conditions);
                Lokad.Enforce.Argument(() => schedule);
                Lokad.Enforce.Argument(() => id);
            }

            m_Executors = executors.ToDictionary(v => v.VertexTypeToProcess, v => v);
            m_Conditions = conditions;
            m_Schedule = schedule;
            m_ScheduleId = id;
            m_ExecutionInfo = new ScheduleExecutionInfo(executionInfo);
        }