Top Description Methods
jakarta.ejb

public @Interface Schedule

extends Annotation
Annotations
@Target:METHOD
@Retention:RUNTIME
@Repeatable:Schedules
Imports
java.lang.annotation.Repeatable, .Target, .Retention

Schedule a timer for automatic creation with a timeout schedule based on a cron-like time expression. The annotated method is used as the timeout callback method.

All elements of this annotation are optional. If none are specified a persistent timer will be created with callbacks occuring every day at midnight in the default time zone associated with the container in which the application is executing.

There are seven elements that constitute a schedule specification which are listed below. In addition, the timezone element may be used to specify a non-default time zone in whose context the schedule specification is to be evaluated; the persistent element may be used to specify a non-persistent timer, and the info element may be used to specify additional information that may be retrieved when the timer callback occurs.

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

Each element supports values expressed in one of the following forms

The following additional rules apply to the schedule specification elements:

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.

The timeout callback method to which the Schedule annotation is applied must have one of the following signatures, where <METHOD> designates the method name:

void <METHOD>()
void <METHOD>(Timer timer)
A timeout callback method can have public, private, protected, or package level access. A timeout callback method must not be declared as final or static. Timeout callback methods must not throw application exceptions.
Since
EJB 3.1

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a java.lang.String object.
dayOfMonth
()

Specifies one or more days within a month.

public String

Returns:

a java.lang.String object.
dayOfWeek
()

Specifies one or more days within a week.

public String

Returns:

a java.lang.String object.
hour
()

Specifies one or more hours within a day.

public String

Returns:

a java.lang.String object.
info
()

Specifies an information string that is associated with the timer

public String

Returns:

a java.lang.String object.
minute
()

Specifies one or more minutes with an hour.

public String

Returns:

a java.lang.String object.
month
()

Specifies one or more months within a year.

public boolean

Returns:

a boolean.
persistent
()

Specifies whether the timer that is created is persistent.

public String

Returns:

a java.lang.String object.
second
()

Specifies one or more seconds with in a minute.

public String

Returns:

a java.lang.String object.
timezone
()

Specifies the time zone within which the schedule is evaluated.

public String

Returns:

a java.lang.String object.
year
()

Specifies one or more years.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

dayOfMonthback to summary
public String dayOfMonth()

Specifies one or more days within a month.

Returns:String

a java.lang.String object.

dayOfWeekback to summary
public String dayOfWeek()

Specifies one or more days within a week.

Returns:String

a java.lang.String object.

hourback to summary
public String hour()

Specifies one or more hours within a day.

Returns:String

a java.lang.String object.

infoback to summary
public String info()

Specifies an information string that is associated with the timer

Returns:String

a java.lang.String object.

minuteback to summary
public String minute()

Specifies one or more minutes with an hour.

Returns:String

a java.lang.String object.

monthback to summary
public String month()

Specifies one or more months within a year.

Returns:String

a java.lang.String object.

persistentback to summary
public boolean persistent()

Specifies whether the timer that is created is persistent.

Returns:boolean

a boolean.

secondback to summary
public String second()

Specifies one or more seconds with in a minute.

Returns:String

a java.lang.String object.

timezoneback to summary
public String timezone()

Specifies the time zone within which the schedule is evaluated. Time zones are specified as an ID string. The set of required time zone IDs is defined by the Zone Name(TZ) column of the public domain zoneinfo database.

If a timezone is not specified, the schedule is evaluated in the context of the default timezone associated with the contianer in which the application is executing.

Returns:String

a java.lang.String object.

yearback to summary
public String year()

Specifies one or more years.

Returns:String

a java.lang.String object.