Skip Headers
Oracle® Application Server Containers for J2EE Job Scheduler Developer's Guide
10g Release 3 (10.1.3)
B15876-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

4 Oracle Application Server Containers for J2EE Blackout Windows

This chapter describes how to create and remove blackout windows. The following topics are covered:

4.1 Adding and Removing Blackout Windows

A blackout window is a period of time during which job executions are not permitted. A blackout window should be used when the system or dependent subsystems are unavailable for a pre-determined amount of time (for example, when the database is down for scheduled maintenance).

To create or add a blackout window, use the oracle.ias.scheduler.Scheduler.addBlackoutWindow() method, which is defined as follows:

public void addBlackoutWindow(java.lang.String windowName,
                              Schedule schedule,
                              long duration)
                       throws DuplicateWindowException,
                              InvalidWindowException,
                              java.rmi.RemoteException

This method provides the parameters described in Table 4-1.

Table 4-1 addBlackoutWindow Parameters

Parameter Description

windowName

Name of the blackout window.

schedule

Start time of the blackout window. Note that the schedule may be a repeating schedule.

duration

Duration (in minutes) of the blackout window.


For more information about the addBlackoutWindow() method, see Oracle Containers for J2EE Job Scheduler API Reference.

Example 4-1 shows how to create a blackout window called "Not in prime time", which is in effect from 8 a.m. to midnight:

Example 4-1 Adding a Blackout Window

// set up the schedule, daily starting at 8 a.m.
Schedule schedule = new Schedule();
Calendar blackoutWindowStartTime = Calendar.getInstance();
blackoutWindowStartTime.set(Calendar.HOUR_OF_DAY,8);
blackoutWindowStartTime.set(Calendar.MINUTE,0);
blackoutWindowStartTime.set(Calendar.SECOND,0);

// create blackout window
scheduler.addBlackoutWindow("Not in prime time", schedule, 960);

4.2 Jobs Scheduled in Blackout Windows

If a job execution occurs when a blackout window is in effect, the job execution is suppressed. If the job was submitted with a retry period enabled, then the job execution will be retried at the period specified.

Figure 4-1 Jobs Scheduled in a Blackout Window with Retry Period Enabled

Job Execution in a Blackout Window
Description of "Figure 4-1 Jobs Scheduled in a Blackout Window with Retry Period Enabled"

In Figure 4-1, a job execution is scheduled to occur at midnight, which falls in a blackout window starting at 11:00 p.m. and ending at 2:00 a.m. If this job had a retry period enabled, the job execution would be retried at 2:00 a.m., when the blackout window ends. Without the retry period enabled, the jobs execution would be suppressed and no attempt to run the job would be made.

Blackout windows takes the highest precedence among all Job Scheduler operations. For more information about job precedence, see Appendix B.

4.3 Frequently Asked Questions About Blackout Windows

What happens if a job is scheduled to be retried (in the event the job fails to run) or replayed (in the event the job is paused) in a blackout window?

The retry (or replay) of the job is suppressed. In other words, the job execution will not occur.