Oracle® Containers for J2EE Job Scheduler Developer's Guide 10g (10.1.3.1.0) Part Number B28954-01 |
|
|
View PDF |
This chapter describes how to create and remove blackout windows. The following topics are covered:
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 |
---|---|
|
Name of the blackout window. |
|
Start time of the blackout window. Note that the schedule may be a repeating schedule. |
|
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);
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
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.
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.