The scheduler provides stateless session bean interfaces which allow creating common calendars which can be used by the scheduler and any J2EE application.
The SchedulerCalendars.ear application is available and provides a default UserCalendar EJB implementation which allows you to use the SIMPLE and CRON calendars. Although this application is not required when using the scheduler, it is available to use from any J2EE application.
For details on how the SIMPLE and CRON calendars behave, see the API documentation for the com.ibm.websphere.scheduler.UserCalendar interface.
Specifying 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.
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 J2EE 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 your 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 you have installed it manually.