Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.core.resources
Interface IResourceRuleFactory  view IResourceRuleFactory download IResourceRuleFactory.java


public interface IResourceRuleFactory

A resource rule factory returns scheduling rules for API methods that modify the workspace. These rules can be used when creating jobs or other operations that perform a series of modifications on the workspace. This allows clients to implement two phase commit semantics, where all necessary rules are obtained prior to executing a long running operation.

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 IWorkspaceRunnable you can use scheduling rules to lock a portion of the workspace for the duration of the job or runnable. If you do so, 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

Method Summary
 org.eclipse.core.runtime.jobs.ISchedulingRule buildRule()
          Returns the scheduling rule that is required for building a project or the entire workspace.
 org.eclipse.core.runtime.jobs.ISchedulingRule copyRule(IResource source, IResource destination)
          Returns the scheduling rule that is required for copying a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule createRule(IResource resource)
          Returns the scheduling rule that is required for creating a project, folder, or file.
 org.eclipse.core.runtime.jobs.ISchedulingRule deleteRule(IResource resource)
          Returns the scheduling rule that is required for deleting a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule markerRule(IResource resource)
          Returns the scheduling rule that is required for creating, modifying, or deleting markers on a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule modifyRule(IResource resource)
          Returns the scheduling rule that is required for modifying a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule moveRule(IResource source, IResource destination)
          Returns the scheduling rule that is required for moving a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule refreshRule(IResource resource)
          Returns the scheduling rule that is required for performing refreshLocal on a resource.
 org.eclipse.core.runtime.jobs.ISchedulingRule validateEditRule(IResource[] resources)
          Returns the scheduling rule that is required for a validateEdit
 

Method Detail

createRule

public org.eclipse.core.runtime.jobs.ISchedulingRule createRule(IResource resource)
Returns the scheduling rule that is required for creating a project, folder, or file.


buildRule

public org.eclipse.core.runtime.jobs.ISchedulingRule buildRule()
Returns the scheduling rule that is required for building a project or the entire workspace.


copyRule

public org.eclipse.core.runtime.jobs.ISchedulingRule copyRule(IResource source,
                                                              IResource destination)
Returns the scheduling rule that is required for copying a resource.


deleteRule

public org.eclipse.core.runtime.jobs.ISchedulingRule deleteRule(IResource resource)
Returns the scheduling rule that is required for deleting a resource.


markerRule

public org.eclipse.core.runtime.jobs.ISchedulingRule markerRule(IResource resource)
Returns the scheduling rule that is required for creating, modifying, or deleting markers on a resource.


modifyRule

public org.eclipse.core.runtime.jobs.ISchedulingRule modifyRule(IResource resource)
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. For all resources touch is considered to be a modification.


moveRule

public org.eclipse.core.runtime.jobs.ISchedulingRule moveRule(IResource source,
                                                              IResource destination)
Returns the scheduling rule that is required for moving a resource.


refreshRule

public org.eclipse.core.runtime.jobs.ISchedulingRule refreshRule(IResource resource)
Returns the scheduling rule that is required for performing refreshLocal on a resource.


validateEditRule

public org.eclipse.core.runtime.jobs.ISchedulingRule validateEditRule(IResource[] resources)
Returns the scheduling rule that is required for a validateEdit