FixedRateTaskConfiguration.java :  » Inversion-of-Control » carbon » org » sape » carbon » services » scheduler » Java Open Source

Java Open Source » Inversion of Control » carbon 
carbon » org » sape » carbon » services » scheduler » FixedRateTaskConfiguration.java
/*
 * The contents of this file are subject to the Sapient Public License
 * Version 1.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * http://carbon.sf.net/License.html.
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * The Original Code is The Carbon Component Framework.
 *
 * The Initial Developer of the Original Code is Sapient Corporation
 *
 * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
 */

package org.sape.carbon.services.scheduler;

import org.sape.carbon.core.util.calendar.DayOfWeekEnum;
import org.sape.carbon.core.util.calendar.MonthEnum;

/**
 * <p>
 * This is the configuration interface used to create fixed rate tasks within
 * the Scheduler Service.  Fixed rate tasks are scheduled to execute at fixed
 * times (e.g. every hour on the hour or every day at 3:30 AM).  Available rates
 * are mintutely, hourly, daily, weekly, monthly (every 30 days), and
 * annually (every 365 days).  The same task can be scheduled multiple times
 * to achieve rates in between (e.g. twice a day).  If the frequency of the
 * task execution is more important than when the task executes, a fixed
 * delay task may be more appropriate.  Also see java.util.Timer for a
 * definition of fixed rate.
 * </p>
 * <p>
 * Valid values for Minute are 0 to 59 inclusive.
 * Valid values for Hour are 0 to 23 inclusive (note no AM or PM).  Valid
 * values for DayOfMonth are 1 to 31 inclusive.  Month is specified by
 * org.sape.carbon.core.util.calendar.MonthEnum.  DayOfWeek is specified by
 * org.sape.carbon.core.util.calendar.DayOfWeekEnum.
 * </p>
 * <p>
 * The scheduling behavior of FixedRateTasks are as follows:
 * <ul>
 * <li>
 * If Minute is not specifed, the task is schedule to start at the beginning
 * of each minute.  An InvalidConfiguraitonException is thrown if
 * other configuration information is specified.
 * </li>
 * <li>
 * If Minute is specifed, but Hour is not, the task is scheduled to run hourly
 * at the minute specifed by Minute.  An InvalidConfiguraitonException is thrown
 * if any of DayOfMonth, Month, and DayOfWeek are specifed.
 * </li>
 * <li>
 * If Minute and Hour are specifed, but DayOfWeek and DayOfMonth are not,
 * the task is scheduled to run daily at the specified time.
 * An InvalidConfiguraitonException is thrown if Month is specifed.
 * </li>
 * <li>
 * If Minute, Hour, and DayOfMonth are specifed, but Month is not, the task
 * is scheduled to run every 30 days starting at the specified day and time.
 * An InvalidConfiguraitonException is thrown if DayOfWeek is specifed.
 * </li>
 * <li>
 * If Minute, Hour, DayOfMonth, and Month are specifed, the task is scheduled
 * to run every 365 days starting at the specified date and time.
 * An InvalidConfiguraitonException is thrown if DayOfWeek is specifed.
 * </li>
 * <li>
 * If Minute, Hour, and DayOfWeek are specifed, but DayOfMonth and Month are
 * not, the task is scheduled to run every 7 days starting at the specified
 * day and time.
 * An InvalidConfiguraitonException is thrown if Month is specifed.
 * </li>
 * </p>
 *
 * @see org.sape.carbon.services.scheduler.FixedDelayTaskConfiguration
 * @see org.sape.carbon.services.scheduler.ScheduleService
 * @see org.sape.carbon.core.util.calendar.DayOfWeekEnum
 * @see org.sape.carbon.core.util.calendar.MonthEnum
 * @see java.util.GregorianCalendar
 * @see java.util.Timer#scheduleAtFixedRate(java.util.TimerTask,java.util.Date,long)
 *
 * Copyright 2002 Sapient
 * @since carbon 1.0
 * @author Douglas Voet, June 2002
 * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:33 $)
 */
public interface FixedRateTaskConfiguration extends BaseTaskConfiguration {
    /**
     * Gets the minute value this task will execute on.
     *
     * @return minute value this task will execute on
     */
    Integer getMinute();

    /**
     * Sets the minute value this task will execute on.
     *
     * @param minute minute value this task will execute on
     */
    void setMinute(Integer minute);

    /**
     * Gets the hour value this task will execute on.
     *
     * @return hour value this task will execute on
     */
    Integer getHour();

    /**
     * Sets the hour value this task will execute on.
     *
     * @param hour hour value this task will execute on
     */
    void setHour(Integer hour);

    /**
     * Gets the day of the month this task will execute on.
     *
     * @return day of the month this task will execute on
     */
    Integer getDayOfMonth();

    /**
     * Sets the day of the month this task will execute on.
     *
     * @param dayOfMonth day of the month this task will execute on
     */
    void setDayOfMonth(Integer dayOfMonth);

    /**
     * Gets the month this task will execute on.
     *
     * @return month this task will execute on
     */
    MonthEnum getMonth();

    /**
     * Sets the month this task will execute on.
     *
     * @param month month this task will execute on
     */
    void setMonth(MonthEnum month);

    /**
     * Gets the day of week this task will execute on.
     *
     * @return day of week this task will execute on
     */
    DayOfWeekEnum getDayOfWeek();

    /**
     * Sets the day of week this task will execute on.
     *
     * @param dayOfWeek day of week this task will execute on
     */
    void setDayOfWeek(DayOfWeekEnum dayOfWeek);

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.