WAS v8.5 > Administer applications and their environment > Welcome to administering Scheduler service > Install default scheduler calendars

Scheduler calendars

The scheduler provides stateless session bean interfaces which allow creating common calendars which can be used by the scheduler and any Java EE application.

The SchedulerCalendars.ear application is available and provides a default UserCalendar EJBs (EJB) implementation which allows using the SIMPLE and CRON calendars. Although this application is not required when using the scheduler, it is available to use from any Java EE application.

For details on how the SIMPLE and CRON calendars behave, see the API documentation for the com.ibm.websphere.scheduler.UserCalendar interface.


Specify a UserCalendar with the scheduler

A UserCalendar is specified using the setUserCalendar() method of the TaskInfo interface of the scheduler. This interface allows you to select the JNDI name of the home interface of a UserCalendar bean. Because some UserCalendar bean implementations might handle multiple types of calendars, the interface also allows you to optionally select which type of calendar to use. A list of valid calendar types can be retrieved by invoking the getCalendarNames() method of the UserCalendar interface.

If the setUserCalendar() method is not invoked, or if a value of null or empty-string is specified for the home JNDI name parameter, then the default UserCalendar is used internally by the scheduler. When the default UserCalendar is accessed internally, it is not necessary the SchedulerCalendars.ear system application be installed.To use the default UserCalendar with a CRON entry, you must switch to the CRON entry manually. The following code sample shows this switch:

BeanTaskInfo taskInfo = (BeanTaskInfo)scheduler.createTaskInfo(BeanTaskInfo.class);
String calendarVariant = "CRON";
taskInfo.setUserCalendar(null, calendarVariant);
// cron table entry String cronTableEntry = "0 17,20,23 * ? * *";
taskInfo.setStartTimeInterval(cronTableEntry);

You might want to use the default UserCalendar directly in your other Java EE applications, apart from the scheduler. In this case, you may use the UserCalendarHome.DEFAULT_CALENDAR_JNDI_NAME value to look up the default UserCalendar from the applications. You may also supply this value to the setUserCalendar() method of the TaskInfo interface. You will need to ensure the SchedulerCalendars.ear system application was either automatically installed or that we have installed it manually.


Related


Install default scheduler calendars
Example: Use default scheduler calendars
Configure schedulers
Develop and schedule tasks


Reference:

Schedulers page
Interoperate with schedulers


Related information:

Example: Stop and starting scheduler daemons using Java Management Extensions API
Example: Dynamically changing scheduler daemon poll intervals using Java Management Extensions API


+

Search Tips   |   Advanced Search