|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.webdav.locking.ResourceLocks
public class ResourceLocks
simple locking management for concurrent data access, NOT the webdav locking. ( could that be used instead? ) IT IS ACTUALLY USED FOR DOLOCK
Field Summary | |
---|---|
protected int |
cleanupCounter
|
protected Hashtable<String,LockedObject> |
locks
keys: path value: LockedObject from that path |
protected Hashtable<String,LockedObject> |
locksByID
keys: id value: LockedObject from that id |
protected LockedObject |
root
|
protected Hashtable<String,LockedObject> |
tempLocks
keys: path value: Temporary LockedObject from that path |
protected Hashtable<String,LockedObject> |
tempLocksByID
keys: id value: Temporary LockedObject from that id |
protected LockedObject |
tempRoot
|
Constructor Summary | |
---|---|
ResourceLocks()
|
Method Summary | |
---|---|
void |
checkTimeouts(ITransaction transaction,
boolean temporary)
Deletes LockedObjects, where timeout has reached. |
boolean |
exclusiveLock(ITransaction transaction,
String path,
String owner,
int depth,
int timeout)
Tries to lock the resource at "path" exclusively. |
LockedObject |
getLockedObjectByID(ITransaction transaction,
String id)
Gets the LockedObject corresponding to specified id. |
LockedObject |
getLockedObjectByPath(ITransaction transaction,
String path)
Gets the LockedObject on specified path. |
LockedObject |
getTempLockedObjectByID(ITransaction transaction,
String id)
Gets the LockedObject corresponding to specified id (locktoken). |
LockedObject |
getTempLockedObjectByPath(ITransaction transaction,
String path)
Gets the LockedObject on specified path. |
boolean |
lock(ITransaction transaction,
String path,
String owner,
boolean exclusive,
int depth,
int timeout,
boolean temporary)
Tries to lock the resource at "path". |
boolean |
sharedLock(ITransaction transaction,
String path,
String owner,
int depth,
int timeout)
Tries to lock the resource at "path" shared. |
boolean |
unlock(ITransaction transaction,
String id,
String owner)
Unlocks all resources at "path" (and all subfolders if existing) that have the same owner. |
void |
unlockTemporaryLockedObjects(ITransaction transaction,
String path,
String owner)
Unlocks all resources at "path" (and all subfolders if existing) that have the same owner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int cleanupCounter
protected Hashtable<String,LockedObject> locks
protected Hashtable<String,LockedObject> locksByID
protected Hashtable<String,LockedObject> tempLocks
protected Hashtable<String,LockedObject> tempLocksByID
protected LockedObject root
protected LockedObject tempRoot
Constructor Detail |
---|
public ResourceLocks()
Method Detail |
---|
public boolean lock(ITransaction transaction, String path, String owner, boolean exclusive, int depth, int timeout, boolean temporary) throws LockFailedException
IResourceLocks
lock
in interface IResourceLocks
path
- what resource to lockowner
- the owner of the lockexclusive
- if the lock should be exclusive (or shared)depth
- depthtimeout
- Lock Duration in seconds.
LockFailedException
public boolean unlock(ITransaction transaction, String id, String owner)
IResourceLocks
unlock
in interface IResourceLocks
id
- id to the resource to unlockowner
- who wants to unlock
public void unlockTemporaryLockedObjects(ITransaction transaction, String path, String owner)
IResourceLocks
unlockTemporaryLockedObjects
in interface IResourceLocks
path
- what resource to unlockowner
- who wants to unlockpublic void checkTimeouts(ITransaction transaction, boolean temporary)
IResourceLocks
checkTimeouts
in interface IResourceLocks
temporary
- Check timeout on temporary or real lockspublic boolean exclusiveLock(ITransaction transaction, String path, String owner, int depth, int timeout) throws LockFailedException
IResourceLocks
exclusiveLock
in interface IResourceLocks
transaction
- Transactionpath
- what resource to lockowner
- the owner of the lockdepth
- depthtimeout
- Lock Duration in seconds.
LockFailedException
public boolean sharedLock(ITransaction transaction, String path, String owner, int depth, int timeout) throws LockFailedException
IResourceLocks
sharedLock
in interface IResourceLocks
transaction
- Transactionpath
- what resource to lockowner
- the owner of the lockdepth
- depthtimeout
- Lock Duration in seconds.
LockFailedException
public LockedObject getLockedObjectByID(ITransaction transaction, String id)
IResourceLocks
getLockedObjectByID
in interface IResourceLocks
id
- LockToken to requested resource
public LockedObject getLockedObjectByPath(ITransaction transaction, String path)
IResourceLocks
getLockedObjectByPath
in interface IResourceLocks
path
- Path to requested resource
public LockedObject getTempLockedObjectByID(ITransaction transaction, String id)
IResourceLocks
getTempLockedObjectByID
in interface IResourceLocks
id
- LockToken to requested resource
public LockedObject getTempLockedObjectByPath(ITransaction transaction, String path)
IResourceLocks
getTempLockedObjectByPath
in interface IResourceLocks
path
- Path to requested resource
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |