KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > WorkspaceLock


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.resources;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.Status;
15
16 /**
17  * A lock used to control write access to the resources in a workspace.
18  * Clients may subclass.
19  *
20  * @see IWorkspace#setWorkspaceLock(WorkspaceLock)
21  * @deprecated it is no longer possible to override the workspace lock behavior.
22  * This functionality is now provided in the platform API by implementing the
23  * org.eclipse.core.runtime.jobs.ILockListener interface.
24  */

25 public class WorkspaceLock {
26
27     /**
28      * Returns a new workspace lock.
29      */

30     public WorkspaceLock(IWorkspace workspace) throws CoreException {
31         //thwart compiler warning
32
if (false)
33             throw new CoreException(Status.OK_STATUS);
34     }
35
36     /**
37      * Attempts to acquire this lock. Callers will block indefinitely until this lock comes
38      * available to them.
39      * <p>
40      * Clients may extend this method but should not otherwise call it.
41      * </p>
42      * @see #release()
43      */

44     public boolean acquire() throws InterruptedException JavaDoc {
45         //thwart compiler warning
46
if (false)
47             throw new InterruptedException JavaDoc();
48         return false;
49     }
50
51     /**
52      * Returns the thread that currently owns the workspace lock.
53      */

54     protected Thread JavaDoc getCurrentOperationThread() {
55         //deprecated API
56
return null;
57     }
58
59     /**
60      * Releases this lock allowing others to acquire it.
61      * <p>
62      * Clients may extend this method but should not otherwise call it.
63      * </p>
64      * @see #acquire()
65      */

66     public void release() {
67         //deprecated API
68
}
69
70     /**
71      * Returns whether the workspace tree is locked
72      * for resource changes.
73      *
74      * @return <code>true</code> if the tree is locked, otherwise
75      * <code>false</code>
76      */

77     protected boolean isTreeLocked() {
78         //deprecated API
79
return true;
80     }
81 }
82
Popular Tags