Interface IResourceRuleFactory
- All Known Implementing Classes:
ResourceRuleFactory
Note that simple use of the workspace APIs does not require use of scheduling
rules. All workspace API methods that modify the workspace will automatically
obtain any scheduling rules needed to perform the modification. However, if you
are aggregating a set of changes to the workspace using WorkspaceJob
or ICoreRunnable
you can use scheduling rules to lock a
portion of the workspace for the duration of the job or runnable. If you
provide a non-null scheduling rule, a runtime exception will occur if you try to
modify a portion of the workspace that is not covered by the rule for the runnable or job.
If more than one rule is needed, they can be aggregated using the
MultiRule.combine
method. Simplifying a group of rules does not change
the set of resources that are covered, but can improve job scheduling performance.
Note that null
is a valid scheduling rule (indicating that no
resources need to be locked), and thus all methods in this class may
return null
.
- Since:
- 3.0
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the scheduling rule that is required for building a project or the entire workspace.charsetRule
(IResource resource) Returns the scheduling rule that is required for changing the charset setting for a file or the default charset setting for a container.Returns the scheduling rule that is required for copying a resource.createRule
(IResource resource) Returns the scheduling rule that is required for creating a project, folder, or file.deleteRule
(IResource resource) Returns the scheduling rule that is required for deleting a resource.derivedRule
(IResource resource) Returns the scheduling rule that is required for changing the derived flag on a resource.markerRule
(IResource resource) Returns the scheduling rule that is required for creating, modifying, or deleting markers on a resource.modifyRule
(IResource resource) Returns the scheduling rule that is required for modifying a resource.Returns the scheduling rule that is required for moving a resource.refreshRule
(IResource resource) Returns the scheduling rule that is required for performingrefreshLocal
on a resource.validateEditRule
(IResource[] resources) Returns the scheduling rule that is required for avalidateEdit
-
Method Details
-
createRule
Returns the scheduling rule that is required for creating a project, folder, or file.- Parameters:
resource
- the resource being created- Returns:
- a scheduling rule, or
null
-
buildRule
ISchedulingRule buildRule()Returns the scheduling rule that is required for building a project or the entire workspace.- Returns:
- a scheduling rule, or
null
-
charsetRule
Returns the scheduling rule that is required for changing the charset setting for a file or the default charset setting for a container.- Parameters:
resource
- the resource for which the charset will be changed- Returns:
- a scheduling rule, or
null
- Since:
- 3.1
-
derivedRule
Returns the scheduling rule that is required for changing the derived flag on a resource.- Parameters:
resource
- the resource for which the derived flag will be changed- Returns:
- a scheduling rule, or
null
- Since:
- 3.6
-
copyRule
Returns the scheduling rule that is required for copying a resource.- Parameters:
source
- the source of the copydestination
- the destination of the copy- Returns:
- a scheduling rule, or
null
-
deleteRule
Returns the scheduling rule that is required for deleting a resource.- Parameters:
resource
- the resource to be deleted- Returns:
- a scheduling rule, or
null
-
markerRule
Returns the scheduling rule that is required for creating, modifying, or deleting markers on a resource.- Parameters:
resource
- the resource owning the marker to be modified- Returns:
- a scheduling rule, or
null
-
modifyRule
Returns the scheduling rule that is required for modifying a resource. For files, modification includes setting and appending contents. For projects, modification includes opening or closing the project, or setting the project description using theIResource.AVOID_NATURE_CONFIG
flag. For all resourcestouch
is considered to be a modification.- Parameters:
resource
- the resource being modified- Returns:
- a scheduling rule, or
null
-
moveRule
Returns the scheduling rule that is required for moving a resource.- Parameters:
source
- the source of the movedestination
- the destination of the move- Returns:
- a scheduling rule, or
null
-
refreshRule
Returns the scheduling rule that is required for performingrefreshLocal
on a resource.- Parameters:
resource
- the resource to refresh- Returns:
- a scheduling rule, or
null
-
validateEditRule
Returns the scheduling rule that is required for avalidateEdit
- Parameters:
resources
- the resources to be validated- Returns:
- a scheduling rule, or
null
-