|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.internal.resources.AliasManager
public class AliasManager
An alias is a resource that occupies the same file system location as another resource in the workspace. When a resource is modified in a way that affects the file on disk, all aliases need to be updated. This class is used to maintain data structures for quickly computing the set of aliases for a given resource, and for efficiently updating all aliases when a resource changes on disk. The approach for computing aliases is optimized for alias-free workspaces and alias-free projects. That is, if the workspace contains no aliases, then updating should be very quick. If a resource is changed in a project that contains no aliases, it should also be very fast. The data structures maintained by the alias manager can be seen as a cache, that is, they store no information that cannot be recomputed from other available information. On shutdown, the alias manager discards all state; on startup, the alias manager eagerly rebuilds its state. The reasoning is that it's better to incur this cost on startup than on the first attempt to modify a resource. After startup, the state is updated incrementally on the following occasions: - when projects are deleted, opened, closed, or moved - when linked resources are created, deleted, or moved.
Nested Class Summary | |
---|---|
class |
AliasManager.AddToCollectionDoit
|
Field Summary | |
---|---|
org.eclipse.core.runtime.IPath |
suffix
The suffix object is also used only during the computeAliases method. |
Constructor Summary | |
---|---|
AliasManager(Workspace workspace)
|
Method Summary | |
---|---|
IResource[] |
computeAliases(IResource resource,
org.eclipse.core.filesystem.IFileStore location)
Returns all aliases of the given resource, or null if there are none. |
void |
handleEvent(LifecycleEvent event)
|
void |
resourceChanged(IResourceChangeEvent event)
Notifies this listener that some resource changes are happening, or have already happened. |
void |
shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
startup(org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
updateAliases(IResource resource,
org.eclipse.core.filesystem.IFileStore location,
int depth,
org.eclipse.core.runtime.IProgressMonitor monitor)
The file underlying the given resource has changed on disk. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public org.eclipse.core.runtime.IPath suffix
Constructor Detail |
---|
public AliasManager(Workspace workspace)
Method Detail |
---|
public IResource[] computeAliases(IResource resource, org.eclipse.core.filesystem.IFileStore location)
public void handleEvent(LifecycleEvent event)
handleEvent
in interface ILifecycleListener
public void resourceChanged(IResourceChangeEvent event)
IResourceChangeListener
The supplied event gives details. This event object (and the resource delta within it) is valid only for the duration of the invocation of this method.
Note: This method is called by the platform; it is not intended to be called directly by clients.
Note that during resource change event notification, further changes to resources may be disallowed.
resourceChanged
in interface IResourceChangeListener
event
- the resource change eventIResourceDelta
public void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
shutdown
in interface IManager
public void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
startup
in interface IManager
public void updateAliases(IResource resource, org.eclipse.core.filesystem.IFileStore location, int depth, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
resource
- the resource to compute aliases forlocation
- the file system location of the resource (passed as a
parameter because in the project deletion case the resource is no longer
accessible at time of update).depth
- whether to search for aliases on all children of the given
resource. Only depth ZERO and INFINITE are used.
org.eclipse.core.runtime.CoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |