Eclipse Platform
2.0

org.eclipse.core.resources
Class WorkspaceLock

java.lang.Object
  |
  +--org.eclipse.core.resources.WorkspaceLock

public class WorkspaceLock
extends Object

A lock used to control write access to the resources in a workspace. Clients may subclass.

See Also:
IWorkspace.setWorkspaceLock(org.eclipse.core.resources.WorkspaceLock)

Constructor Summary
WorkspaceLock(IWorkspace workspace)
          Returns a new workspace lock.
 
Method Summary
 boolean acquire()
          Attempts to acquire this lock.
protected  Thread getCurrentOperationThread()
          Returns the thread that currently owns the workspace lock.
protected  boolean isTreeLocked()
          Returns whether the workspace tree is locked for resource changes.
 void release()
          Releases this lock allowing others to acquire it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceLock

public WorkspaceLock(IWorkspace workspace)
              throws CoreException
Returns a new workspace lock.

Method Detail

acquire

public boolean acquire()
                throws InterruptedException
Attempts to acquire this lock. Callers will block indefinitely until this lock comes available to them.

Clients may extend this method but should not otherwise call it.

InterruptedException
See Also:
release()

getCurrentOperationThread

protected Thread getCurrentOperationThread()
Returns the thread that currently owns the workspace lock.


release

public void release()
Releases this lock allowing others to acquire it.

Clients may extend this method but should not otherwise call it.

See Also:
acquire()

isTreeLocked

protected boolean isTreeLocked()
Returns whether the workspace tree is locked for resource changes.

Returns:
true if the tree is locked, otherwise false

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.