Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.core.runtime.jobs
Interface ISchedulingRule

All Known Subinterfaces:
  IContainer, IFile, IFolder, IProject, IResource, IWorkspaceRoot

All Known Implementing Classes:
  MultiRule

public interface ISchedulingRule

Scheduling rules are used by jobs to indicate when they need exclusive access to a resource. Scheduling rules can also be applied synchronously to a thread using `IJobManager.beginRule(ISchedulingRule)` and `IJobManager.endRule(ISchedulingRule)`. The job manager guarantees that no two jobs with conflicting scheduling rules will run concurrently. Multiple rules can be applied to a given thread only if the outer rule explicitly allows the nesting as specifed by the `contains` method.

Clients may implement this interface.

Since:
  3.0
See Also:
  `Job.getRule()`, `Job.setRule(ISchedulingRule)`, `IJobManager.beginRule(ISchedulingRule, org.eclipse.core.runtime.IProgressMonitor)`, `IJobManager.endRule(ISchedulingRule)`

Method Summary
`boolean` | `contains(ISchedulingRule rule)` Returns whether this scheduling rule completely contains another scheduling rule.
`boolean` | `isConflicting(ISchedulingRule rule)` Returns whether this scheduling rule is compatible with another scheduling rule.

Method Detail

### contains

    public boolean contains(ISchedulingRule rule)

  Returns whether this scheduling rule completely contains another scheduling rule. Rules can only be nested within a thread if the inner rule is completely contained within the outer rule.

  Implementations of this method must obey the rules of a partial order relation on the set of all scheduling rules. In particular, implementations must be reflexive (a.contains(a) is always true), antisymmetric (a.contains(b) and b.contains(a) iff a.equals(b), and transitive (if a.contains(b) and b.contains(c), then a.contains(c)). Implementations of this method must return `false` when compared to a rule they know nothing about.

  Parameters:
    `rule` - the rule to check for containment
  Returns:
    `true` if this rule contains the given rule, and `false` otherwise.

### isConflicting

    public boolean isConflicting(ISchedulingRule rule)

  Returns whether this scheduling rule is compatible with another scheduling rule. If `true` is returned, then no job with this rule will be run at the same time as a job with the conflicting rule. If `false` is returned, then the job manager is free to run jobs with these rules at the same time.

  Implementations of this method must be reflexive, symmetric, and consistent, and must return `false` when compared to a rule they know nothing about.

  Parameters:
    `rule` - the rule to check for conflicts
  Returns:
    `true` if the rule is conflicting, and `false` otherwise.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.