This presentation will discuss the Scheduler Service available in IBM WebSphere Application Server V6. This service allows you to schedule time-dependent actions. WASv6_Scheduler.ppt Page 1 of 18
The goals of this presentation are to gain an understanding of the Scheduler Service programming model extension, learn how to enable and configure the Scheduler Service, and understand the new enhancements in V6. WASv6_Scheduler.ppt Page 2 of 18
The agenda for this presentation is to provide an overview of the Scheduler Service, understand how to configure and manage the service, learn about the two types of tasks that can be invoked, and highlight enhancements in WebSphere Application Server V6. WASv6_Scheduler.ppt Page 3 of 18
This section will provide you with an overview of the Scheduler Service. WASv6_Scheduler.ppt Page 4 of 18
The scheduler service provides a persistent and transactional timer service. It allows you to schedule actions to happen once, some time in the future, or on a periodic basis. Scheduled tasks can invoke methods on a user-provided session EJB or can send a message to a JMS destination or topic. Once a task has been scheduled, the scheduler service stores the task definition in relational database tables. The relational database ensures that the task definition persists through stopping and starting the application servers. WASv6_Scheduler.ppt Page 5 of 18
A Calendar is needed to schedule the tasks. The primary objective of the calendar is to calculate the point in time in the future when a task needs to run. WebSphere Application Server provides a default calendar implementation with two calendars, a CRON-syntax and a simple arithmetic syntax calendar. You may also create your own user-defined calendars to account for special definitions that may be determined by your locality or by your business needs. For example, you could create a user-defined calendar specific to your number of working days and holidays. The Scheduler is a special resource that can be configured with WebSphere Application Server administrative facilities. The Scheduler can be workload managed for availability. WASv6_Scheduler.ppt Page 6 of 18
A cell may include one or more schedulers. You may want to create multiple schedulers to meet different requirements in regards to load, availability and security. Before you can use the scheduler, you must create the database tables that the scheduler needs and configure a datasource. Each scheduler is associated with a set of database tables, which are accessible through a datasource. Different schedulers can use the same datasource, as long as they are configured to use a different set of tables. WASv6_Scheduler.ppt Page 7 of 18
A scheduler has its own JNDI name that allows a client to access it. Once a scheduler is configured, application servers will start a "daemon" scheduler associated with the scheduler definition. This "daemon" polls at regular, configurable intervals and looks into the relational database tables to find out whether there are any tasks that need to be fired in the subsequent interval. When a task needs to be fired, the scheduler uses alarms and a WorkManager to control and activate the task firing. WASv6_Scheduler.ppt Page 8 of 18
Use the Administrative Console to create and configure a scheduler. Select Resources > Scheduler and complete the appropriate values as required. Note the Work Manager setting which provides the scheduler with a fixed number of threads upon which to dispatch work and a policy that determines how to propagate J2EE context information onto a thread. WASv6_Scheduler.ppt Page 9 of 18
Schedulers normally should be created at the "Cluster" scope or "Server" scope. Schedulers created at the node scope can cause problems unless all applications that the scheduler interfaces with are mapped to every server in the node. Normally, you would create a single scheduler at the Cluster scope and map your applications to that cluster. WASv6_Scheduler.ppt Page 10 of 18
Use the Administrative Console or the WASSchedulerConfiguration MBeans to create or drop relational database tables for your Scheduler in simple topologies, such as development environments. The table management functions are especially useful in prototyping where the database may simply reside on the developer s machine. Use the supplied Scheduler data definition language files to create or drop relational database tables for advanced topologies, such as production environments. Production environments typically are fairly restrictive and highly-tuned. The table management functions may not be allowed with the userid of the application developer or administrator. The database administrator may have to make other alterations to the table schema to allow it to fit within the database infrastructure. WASv6_Scheduler.ppt Page 11 of 18
When you schedule a task, you need to give the scheduler one of two object instances, a BeanTaskInfo, where you define which EJB task handler should be called when the task is due; or a MessageTaskInfo, where you define the characteristics of the message to be sent and the destination to which the message should be sent, when the task is due. You can schedule tasks and interact with a scheduler by writing Java code using the Scheduler API from a Java 2 Enterprise Edition (J2EE) server application or by using the JMX API and it s associated WASScheduler MBean. The scheduler is only available to server side components where the scheduler daemon is running (similar to a local interface). If a scheduler resource is defined at the node level, for instance, all the application servers on that node have access to that scheduler and will run its daemon. You can selectively disable the daemon on an application server. WASv6_Scheduler.ppt Page 12 of 18
When a task is scheduled, you will specify how frequently it runs and how many times you want it to run (can be one time only). The TaskHandler, NotificationSink, and UserCalendar beans can be workload managed for failover. WASv6_Scheduler.ppt Page 13 of 18
If you are familiar with the Scheduler feature available in previous versions of WebSphere Business Integration Server Foundation, there are new enhancements added in WebSphere Application Server V6 which provide a function-rich approach to scheduling simple tasks. You can now access most scheduler methods using JMX, in addition to the scheduler API. The security model uses an alias which is configured in the Administrative Console; as a consequence, you can change user ID and password values on the alias without having to modify the scheduled tasks. WASv6_Scheduler.ppt Page 14 of 18
Scheduler function can be constrained by the administrative roles so that some users can have effectively read only access. And database administration improvements mean that you can more easily modify tables for a scheduler. WASv6_Scheduler.ppt Page 15 of 18
And, in summary WASv6_Scheduler.ppt Page 16 of 18
In this presentation you learned about the Scheduler Service and it s functionality. Tasks can be scheduled to invoke Session EJBs or to send JMS messages. Management capabilities are available with Java APIs or JMX. You also were presented with the new enhancements available with WebSphere Application Server V6. WASv6_Scheduler.ppt Page 17 of 18
WASv6_Scheduler.ppt Page 18 of 18