|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
weblogic.jms.extensions.Schedule
public final class Schedule
Time Scheduler
This class provides methods that take a schedule and a time and return the next scheduled time. A cron-like string is used to define the schedule. The format is specified in the following BNF syntax:
schedule := millisecond second minute hour dayOfMonth month dayOfWeek
The BNF syntax for specifying the second field is as follows:
second := * | secondList secondList := secondItem [, secondList] secondItem := secondValue | secondRange secondRange := secondValue - secondValue
Similar BNF statements for milliseconds, minute, hour, dayOfMonth, month, and dayOfWeek can be derived from the second syntax. The values for each field are defined as non-negative integers in the following ranges:
milliSecondValue := 0-999 secondValue := 0-59 minuteValue := 0-59 hourValue := 0-23 dayOfMonthValue := 1-31 monthValue := 1-12 dayOfWeekValue := 1-7
Note: These values equate to the same ranges that the java.util.Calendar class uses, except for 'monthValue'. The java.util.Calendar range for 'monthValue' is 0-11, rather than 1-12.
Using this syntax, each field can be represented as a range of values indicating all times between the two times. For example, "2-6" in the dayOfWeek field indicates Monday through Friday, inclusive. Each field can also be specified as a comma separated list. For instance, a minute field of "0,15,30,45" means every quarter hour on the quarter hour. Lastly, each field can be defined as both a set of individual values and ranges of values. For example, an hour field of "9-17,0" indicates between the hours of 9 am and 5 pm, and on the hour of midnight.
Additional semantics are as follows:
Note: When a Calendar is not supplied as a method parameter to one of the static methods in this class, the calendar used is a java.util.GregorianCalendar with a default java.util.TimeZone and a default java.util.Locale.
Examples:
"0 0 0,30 * * * *" Exact next nearest half-hour "* * 0,30 4-5 * * *" Anytime in the first minute of the half hours in the 4 and 5 o'clock AM hours "* * * 9-16 * * *" Between 9 AM and 5 PM (9:00.00 AM to 4:59.59PM) "* * * * 8-14 * 2" The second Tuesday of the month "* * * 13-16 * * 0" Between 1 PM and 5 pm on Sunday "* * * * * 31 *" The last day of the month "* * * * 15 4 1" The next time April 15th occurs on a Sunday "0 0 0 1 * * 2-6;0 0 0 2 * * 1,7" 1 AM on the weekdays, 2 AM on the weekends
Calendar
, GregorianCalendar
, TimeZone
Method Summary | |
---|---|
static void |
main(String[] args) Unsupported command line interface, may change without notice. |
static Calendar |
nextScheduledTime(String schedule) The next scheduled time after the current time. |
static Calendar |
nextScheduledTime(String schedule, Calendar calendar) Get the next scheduled time after the given time. |
static long |
nextScheduledTimeInMillis(String schedule) The next scheduled time after the current time. |
static long |
nextScheduledTimeInMillis(String schedule, long timeInMillis) The next scheduled time after the given time. |
static long |
nextScheduledTimeInMillisRelative(String schedule) The next scheduled time after the current time. |
static long |
nextScheduledTimeInMillisRelative(String schedule, long timeInMillis) Get the next scheduled time after the given time. |
static void |
parseSchedule(String schedule) Throw a ParseException if the given schedule doesn't parse. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void parseSchedule(String schedule) throws ParseException
ParseException
- Syntax error in schedule.public static Calendar nextScheduledTime(String schedule, Calendar calendar) throws ParseException
ParseException
- Syntax error in schedule.public static Calendar nextScheduledTime(String schedule) throws ParseException
ParseException
Schedule.nextScheduledTime(String, Calendar)
public static long nextScheduledTimeInMillis(String schedule, long timeInMillis) throws ParseException
timeInMillis
- the time in UTC milliseconds from the epoch.ParseException
public static long nextScheduledTimeInMillis(String schedule) throws ParseException
ParseException
public static long nextScheduledTimeInMillisRelative(String schedule, long timeInMillis) throws ParseException
timeInMillis
- the time in UTC milliseconds from the epoch.ParseException
public static long nextScheduledTimeInMillisRelative(String schedule) throws ParseException
ParseException
Schedule.nextScheduledTimeInMillisRelative(String, long)
public static void main(String[] args) throws Exception
Exception
|
Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |