Chapter 3. Scheduler Configuration

Table of Contents

3.1. Overview
3.2. Configuring Job-list
3.3. Configuring Server Scheduler
3.4. Configuring Thread Pool
3.4.1. Shared Thread Pool
3.4.2. Dedicated Thread Pool
3.5. Configuring Client Container

This chapter describes how to configure JEUS Scheduler in a JEUS configuration file or Deployment Descriptor(DD).

The following configuration is required to use a JEUS Scheduler service.

To use the scheduler, scheduler service must be activated and the thread pool and Job-list must be configured.

This section describes how to register jobs.

A job can be registered programmatically or be configured to be scheduled at JEUS server startup in the JEUS configuration file. A job is a single task unit that is scheduled. A job class must implement the jeus.schedule.ScheduleListener interface, and the class and its related classes must be compressed into a jar file and saved in the following location.

Since the following directory is not synchronized between Domain Administration Server(hereafter DAS) and Managed Server(hereafter MS), the user must synchronize them manually.

DOMAIN_HOME/lib/application

The following directory must be created manually in the following path by the user.

SERVER_HOME/lib/application

JEUS Scheduler Service executes jobs that are configured on the server.

The following items must be configured with care.

ItemDescription
Begin Time

Initial time to execute the task. If not set, the task executes when JEUS server starts.

  • Type: XML dateTime type

  • Format: yyyy-mm-ddThh:mm:ss.sss

If the Begin Time of a registered job has already passed, the initial execution time is adjusted to a time after the current time.

End Time

Time when the task terminates. If not set, the task does not terminate.

  • Type: XML dateTime type

  • Format: yyyy-mm-ddThh:mm:ss.sss

If End Time has already passed, the task does not execute at all.

Count

Maximum number of executions.

If Count is not set or set to -1, there is no limit for the number of executions.

Note

If a task is registered in the Job-list, the task executes at a fixed-rate in relative time. If a task execution is delayed, same tasks may be executed concurrently and task objects should be checked for thread-safety.

This section describes how to configure the scheduler on the server using WebAdmin.

To access the JEUS server Scheduler Service or to execute a recurring task on JEUS server using Job-list, the Scheduler Service must be activated in WebAdmin. To activate the Service, it must be configured for use in WebAdmin, and then the server starts the Scheduler Service when the server boots.

The following are the steps for adding the job from "2.3.2. Schedule Class Inheritance" to the server.

  1. Click [Servers] on the left menu to show the list of servers. Click a server (server1) to change its scheduler configuration from the list.


  2. On the Servers screen, select [Resource] > [Scheduler] to go to the Scheduler configuration page.


  3. Click [Lock & Edit] under the left menu to get the lock to change the scheduler configurations. For more information about the lock configuration, refer to JEUS WebAdmin Guide. "2.4.4. Locking the Configuration".

    The scheduler configuration can be changed after getting the lock.


  4. Check 'Enabled' and set the thread pool information in the advanced options that are used in the scheduler. For more information about the scheduler's thread pool, refer to "3.4. Configuring Thread Pool".

    After completing the configuration, click [OK]. If saved successfully, the result message is displayed at the top of the page. Skip this step If 'Enabled' is checked.


  5. To add a job, click [Add] in the Job list.


  6. On the Job configuration page, enter the class name and job execution cycle, and click [OK].


  7. The following is the result of temporarily saving the changes by clicking [OK]. The result message is displayed at the top of the page and the added job appears in the Job list.


  8. Click [Apply Changes] to apply the changes to the scheduler.

    Note

    Scheduler configuration chages are not applied dynamically. The changes take effect after the server restarts.


  9. When the server restarts, the newly created job executes and the result can be checked in the server logs.

    ##### waked on Tue Apr 23 14:50:19 KST 2013
    ##### waked on Tue Apr 01 15:20:19 KST 2013

Scheduler Service adjusts the thread pool to the required number of threads for service execution. The thread pool is divided into the System Thread Pool and Dedicated Thread Pool.

This section describes how to set a thread pool using WebAdmin and the console tool. For more information, refer to JEUS Server Guide. "2.3.3. Thread Pool Configuration".

If the Scheduler Service uses a shared thread pool, only the number of threads needs to be configured.

Using WebAdmin

This section describes how to set the thread pool using WebAdmin. Before setting the thread pool, the lock setting must be changed.

Using the Console Tool

The following shows how to set the thread pool of the scheduler using the console tool jeusadmin.


If the Scheduler Service uses the dedicated thread pool, the thread pool can be configured using WebAdmin or the console tool (jeusadmin). This section describes how to configure the dedicated thread pool using WebAdmin and the console tool.

Using WebAdmin

The following describes how to set the thread pool using WebAdmin. The lock should be set before configuring the thread pool.

Using the Console Tool

The following shows how to configure the scheduler's thread pool using the console tool (jeusadmin).


Note

The thread pool configuration of the Scheduler Service is dynamic and therefore the server does not need to be restarted. However, the server must be restarted when changing from using the shared thread pool to the dedicated thread pool for changes to take effect.

This section describes how to configure the JEUS Scheduler that is running on a client container when using a Java EE application. Add the following <scheduler> element to the JEUS DD file, jeus-client-dd.xml.


To apply the changes after modifying the previous configuration file, the JEUS server does not need to be restarted, but client modules and client containers must be restarted.

The following shows how to set jobs that run on client containers.