Top Description Fields Constructors Methods
javax.ejb

public Class ScheduleExpression

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.Date, 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

Field Summary

Modifier and TypeField and Description
private String
private String
private Date
private String
private String
private String
private String
private static final long
private Date
private String
private String

Constructor Summary

AccessConstructor and Description
public
ScheduleExpression()

Create a schedule with the default values.

Method Summary

Modifier and TypeMethod and Description
public ScheduleExpression
dayOfMonth(String
the attribute value as a String
d
)

Set the day of the month attribute.

public ScheduleExpression
dayOfMonth(int
the attribute value as an int, if the value is a simple integer value
d
)

Set the day of the month attribute.

public ScheduleExpression
dayOfWeek(String
the attribute value as a String
d
)

Set the day of the week attribute.

public ScheduleExpression
dayOfWeek(int
the attribute value as an int, if the value is a simple integer value
d
)

Set the day of the week attribute.

public ScheduleExpression
end(Date
the end date
e
)

Set the end date.

public String

Returns:

day of the month
getDayOfMonth
()

Return the value of the day of the month attribute.

public String

Returns:

day of the week
getDayOfWeek
()

Return the value of the day of the week attribute.

public Date

Returns:

end date
getEnd
()

Return the end date, if set; otherwise null.

public String

Returns:

hour
getHour
()

Return the value of the hour attribute.

public String

Returns:

minute
getMinute
()

Return the value of the minute attribute.

public String

Returns:

month
getMonth
()

Return the value of the month attribute.

public String

Returns:

second
getSecond
()

Return the value of the second attribute.

public Date

Returns:

start date
getStart
()

Return the start date, if set; otherwise null.

public String

Returns:

timezone
getTimezone
()

Return the timezone, if set; otherwise null.

public String

Returns:

year
getYear
()

Return the value of the year attribute.

public ScheduleExpression
hour(String
the attribute value as a String
h
)

Set the hour attribute.

public ScheduleExpression
hour(int
the attribute value as an int, if the value is a simple integer value
h
)

Set the hour attribute.

public ScheduleExpression
minute(String
the attribute value as a String
m
)

Set the minute attribute.

public ScheduleExpression
minute(int
the attribute value as an int, if the value is a simple integer value
m
)

Set the minute attribute.

public ScheduleExpression
month(String
the attribute value as a String
m
)

Set the month attribute.

public ScheduleExpression
month(int
the attribute value as an int, if the value is a simple integer value
m
)

Set the month attribute.

public ScheduleExpression
second(String
the attribute value as a String
s
)

Set the second attribute.

public ScheduleExpression
second(int
the attribute value as an int, if the value is a simple integer value
s
)

Set the second attribute.

public ScheduleExpression
start(Date
the start date
s
)

Set the start date.

public ScheduleExpression
timezone(String
the Time zone specified as an ID String
timezoneID
)

Set the timezone.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public ScheduleExpression
year(String
the attribute value as a String
y
)

Set the year attribute.

public ScheduleExpression
year(int
the attribute value as an int, if the value is a simple integer value
y
)

Set the year attribute.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

dayOfMonth_back to summary
private String dayOfMonth_
dayOfWeek_back to summary
private String dayOfWeek_
end_back to summary
private Date end_
hour_back to summary
private String hour_
minute_back to summary
private String minute_
month_back to summary
private String month_
second_back to summary
private String second_
serialVersionUIDback to summary
private static final long serialVersionUID
start_back to summary
private Date start_
timezoneID_back to summary
private String timezoneID_
year_back to summary
private String year_

Constructor Detail

ScheduleExpressionback to summary
public ScheduleExpression()

Create a schedule with the default values.

Method Detail

dayOfMonthback to summary
public ScheduleExpression dayOfMonth(String d)

Set the day of the month attribute.

Parameters
d:String

the attribute value as a String

dayOfMonthback to summary
public ScheduleExpression dayOfMonth(int d)

Set the day of the month attribute.

Parameters
d:int

the attribute value as an int, if the value is a simple integer value

dayOfWeekback to summary
public ScheduleExpression dayOfWeek(String d)

Set the day of the week attribute.

Parameters
d:String

the attribute value as a String

dayOfWeekback to summary
public ScheduleExpression dayOfWeek(int d)

Set the day of the week attribute.

Parameters
d:int

the attribute value as an int, if the value is a simple integer value

endback to summary
public ScheduleExpression end(Date e)

Set the end date.

Parameters
e:Date

the end date

getDayOfMonthback to summary
public String getDayOfMonth()

Return the value of the day of the month attribute.

Returns:String

day of the month

getDayOfWeekback to summary
public String getDayOfWeek()

Return the value of the day of the week attribute.

Returns:String

day of the week

getEndback to summary
public Date getEnd()

Return the end date, if set; otherwise null.

Returns:Date

end date

getHourback to summary
public String getHour()

Return the value of the hour attribute.

Returns:String

hour

getMinuteback to summary
public String getMinute()

Return the value of the minute attribute.

Returns:String

minute

getMonthback to summary
public String getMonth()

Return the value of the month attribute.

Returns:String

month

getSecondback to summary
public String getSecond()

Return the value of the second attribute.

Returns:String

second

getStartback to summary
public Date getStart()

Return the start date, if set; otherwise null.

Returns:Date

start date

getTimezoneback to summary
public String getTimezone()

Return the timezone, if set; otherwise null.

Returns:String

timezone

getYearback to summary
public String getYear()

Return the value of the year attribute.

Returns:String

year

hourback to summary
public ScheduleExpression hour(String h)

Set the hour attribute.

Parameters
h:String

the attribute value as a String

hourback to summary
public ScheduleExpression hour(int h)

Set the hour attribute.

Parameters
h:int

the attribute value as an int, if the value is a simple integer value

minuteback to summary
public ScheduleExpression minute(String m)

Set the minute attribute.

Parameters
m:String

the attribute value as a String

minuteback to summary
public ScheduleExpression minute(int m)

Set the minute attribute.

Parameters
m:int

the attribute value as an int, if the value is a simple integer value

monthback to summary
public ScheduleExpression month(String m)

Set the month attribute.

Parameters
m:String

the attribute value as a String

monthback to summary
public ScheduleExpression month(int m)

Set the month attribute.

Parameters
m:int

the attribute value as an int, if the value is a simple integer value

secondback to summary
public ScheduleExpression second(String s)

Set the second attribute.

Parameters
s:String

the attribute value as a String

secondback to summary
public ScheduleExpression second(int s)

Set the second attribute.

Parameters
s:int

the attribute value as an int, if the value is a simple integer value

startback to summary
public ScheduleExpression start(Date s)

Set the start date.

Parameters
s:Date

the start date

timezoneback to summary
public ScheduleExpression timezone(String timezoneID)

Set the timezone.

Parameters
timezoneID:String

the Time zone specified as an ID String

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

yearback to summary
public ScheduleExpression year(String y)

Set the year attribute.

Parameters
y:String

the attribute value as a String

yearback to summary
public ScheduleExpression year(int y)

Set the year attribute.

Parameters
y:int

the attribute value as an int, if the value is a simple integer value