Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer 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 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 interface...
com.ibm.websphere.scheduler.UserCalendar
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 that the SchedulerCalendars.ear system application be installed.To use the default UserCalendar with a CRON entry, 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 can use the default UserCalendar in other Java EE applications, apart from the scheduler. In this case, you may use the value...
UserCalendarHome.DEFAULT_CALENDAR_JNDI_NAME
...to look up the default UserCalendar from the applications. You may also supply this value to the setUserCalendar() method of the TaskInfo interface. Ensure the SchedulerCalendars.ear system application is installed.
Install default scheduler calendars
Example: Using default scheduler calendars
Configure schedulers
Scheduling tasks
Related
Schedulers collection
Interoperating with schedulers
Example: Stopping and starting scheduler daemons using Java Management Extensions API
Example: Dynamically changing scheduler daemon poll intervals using Java Management Extensions API