Rules can be nested only if the rule for the inner beginRule is contained within the rule for the outer beginRule. Rule containment is tested with the API method ISchedulingRule.contains. Also, begin/end pairs must be strictly nested. Only the rule that has most recently begun can be ended at any given time.
A rule of null
can be used, but will be ignored for scheduling purposes. The outermost non-null rule in the thread will be used for scheduling. A null
rule that is begun must still be ended.
If this method is called from within a job that has a scheduling rule, the given rule must also be contained within the rule for the running job.
Note that endRule must be called even if beginRule fails. The recommended usage is:
final ISchedulingRule rule = ...; try { manager.beginRule(rule, monitor); } finally { manager.endRule(rule); }@param rule the rule to begin applying in this thread, or
null
@param monitor a progress monitor, or null
if progressreporting and cancellation are not desired
@throws IllegalArgumentException if the rule is not strictly nested withinall other rules currently active for this thread
@throws OperationCanceledException if the supplied monitor reports cancelationbefore the rule becomes available
@see ISchedulingRule#contains(ISchedulingRule)
|
|