javax.ejb
Class ScheduleExpression

java.lang.Object
  extended by javax.ejb.ScheduleExpression
All Implemented Interfaces:
java.io.Serializable

public class ScheduleExpression
extends java.lang.Object
implements java.io.Serializable

A calendar-based timeout expression for an enterprise bean timer.

Each attribute used to define a calendar-based timeout schedule has two overloaded setter methods, one that takes a String and one that takes an int. The int version is merely a convenience method for setting the attribute in the common case that the value is a simple integer value.

For example,

scheduleExpression.second(10)
is semantically equivalent to
scheduleExpression.second("10")

There are seven attributes that constitute a schedule specification which are listed below. In addition, the timezone attribute may be used to specify a non-default time zone in whose context the schedule specification is to be evaluated.

The attributes that specify the calendar-based schedule itself are as follows:

Each attribute supports values expressed in one of the following forms

The following additional rules apply to the schedule specification attributes:

Schedule-based timer times are evaluated in the context of the default time zone associated with the container in which the application is executing. A schedule-based timer may optionally override this default and associate itself with a specific time zone. If the schedule-based timer is associated with a specific time zone, all its times are evaluated in the context of that time zone, regardless of the default time zone in which the container is executing.

None of the ScheduleExpression methods are required to be called. The defaults are :

Applications must not rely on the getter methods that return the attributes of a calendar-based timeout schedule to return them in the same syntactic format in which they were passed in to a ScheduleExpression method or supplied to the Schedule annotation, and portable implementations must not assume any particular syntactic format. Implementations are required only to preserve semantic equivalence.

Since:
EJB 3.1
See Also:
Serialized Form

Constructor Summary
ScheduleExpression()
          Create a schedule with the default values.
 
Method Summary
 ScheduleExpression dayOfMonth(int d)
          Set the day of the month attribute.
 ScheduleExpression dayOfMonth(java.lang.String d)
          Set the day of the month attribute.
 ScheduleExpression dayOfWeek(int d)
          Set the day of the week attribute.
 ScheduleExpression dayOfWeek(java.lang.String d)
          Set the day of the week attribute.
 ScheduleExpression end(java.util.Date e)
          Set the end date.
 java.lang.String getDayOfMonth()
          Return the value of the day of the month attribute.
 java.lang.String getDayOfWeek()
          Return the value of the day of the week attribute.
 java.util.Date getEnd()
          Return the end date, if set; otherwise null.
 java.lang.String getHour()
          Return the value of the hour attribute.
 java.lang.String getMinute()
          Return the value of the minute attribute.
 java.lang.String getMonth()
          Return the value of the month attribute.
 java.lang.String getSecond()
          Return the value of the second attribute.
 java.util.Date getStart()
          Return the start date, if set; otherwise null.
 java.lang.String getTimezone()
          Return the timezone, if set; otherwise null.
 java.lang.String getYear()
          Return the value of the year attribute.
 ScheduleExpression hour(int h)
          Set the hour attribute.
 ScheduleExpression hour(java.lang.String h)
          Set the hour attribute.
 ScheduleExpression minute(int m)
          Set the minute attribute.
 ScheduleExpression minute(java.lang.String m)
          Set the minute attribute.
 ScheduleExpression month(int m)
          Set the month attribute.
 ScheduleExpression month(java.lang.String m)
          Set the month attribute.
 ScheduleExpression second(int s)
          Set the second attribute.
 ScheduleExpression second(java.lang.String s)
          Set the second attribute.
 ScheduleExpression start(java.util.Date s)
          Set the start date.
 ScheduleExpression timezone(java.lang.String timezoneID)
          Set the timezone.
 java.lang.String toString()
           
 ScheduleExpression year(int y)
          Set the year attribute.
 ScheduleExpression year(java.lang.String y)
          Set the year attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScheduleExpression

public ScheduleExpression()
Create a schedule with the default values.

Method Detail

second

public ScheduleExpression second(java.lang.String s)
Set the second attribute.


second

public ScheduleExpression second(int s)
Set the second attribute.


getSecond

public java.lang.String getSecond()
Return the value of the second attribute.

Returns:
second

minute

public ScheduleExpression minute(java.lang.String m)
Set the minute attribute.


minute

public ScheduleExpression minute(int m)
Set the minute attribute.


getMinute

public java.lang.String getMinute()
Return the value of the minute attribute.

Returns:
minute

hour

public ScheduleExpression hour(java.lang.String h)
Set the hour attribute.


hour

public ScheduleExpression hour(int h)
Set the hour attribute.


getHour

public java.lang.String getHour()
Return the value of the hour attribute.

Returns:
hour

dayOfMonth

public ScheduleExpression dayOfMonth(java.lang.String d)
Set the day of the month attribute.


dayOfMonth

public ScheduleExpression dayOfMonth(int d)
Set the day of the month attribute.


getDayOfMonth

public java.lang.String getDayOfMonth()
Return the value of the day of the month attribute.

Returns:
day of the month

month

public ScheduleExpression month(java.lang.String m)
Set the month attribute.


month

public ScheduleExpression month(int m)
Set the month attribute.


getMonth

public java.lang.String getMonth()
Return the value of the month attribute.

Returns:
month

dayOfWeek

public ScheduleExpression dayOfWeek(java.lang.String d)
Set the day of the week attribute.


dayOfWeek

public ScheduleExpression dayOfWeek(int d)
Set the day of the week attribute.


getDayOfWeek

public java.lang.String getDayOfWeek()
Return the value of the day of the week attribute.

Returns:
day of the week

year

public ScheduleExpression year(java.lang.String y)
Set the year attribute.


year

public ScheduleExpression year(int y)
Set the year attribute.


getYear

public java.lang.String getYear()
Return the value of the year attribute.

Returns:
year

timezone

public ScheduleExpression timezone(java.lang.String timezoneID)
Set the timezone.


getTimezone

public java.lang.String getTimezone()
Return the timezone, if set; otherwise null.

Returns:
timezone

start

public ScheduleExpression start(java.util.Date s)
Set the start date.


getStart

public java.util.Date getStart()
Return the start date, if set; otherwise null.

Returns:
start date

end

public ScheduleExpression end(java.util.Date e)
Set the end date.


getEnd

public java.util.Date getEnd()
Return the end date, if set; otherwise null.

Returns:
end date

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41