org.sourceforge.jemm.database.persistent.berkeley
Class BDbStorageEngineUserLockImpl

java.lang.Object
  extended by org.sourceforge.jemm.database.persistent.berkeley.BDbStorageEngineUserLockImpl
All Implemented Interfaces:
StorageEngineUserLockIF

public class BDbStorageEngineUserLockImpl
extends java.lang.Object
implements StorageEngineUserLockIF


Constructor Summary
BDbStorageEngineUserLockImpl(com.sleepycat.persist.EntityStore store)
           
 
Method Summary
 void addClientLockReference(ClientThreadId clientThreadId, ID objectId)
          Add a reference from a client to the given object.
 void clearAll()
          Clear all lock information.
 java.util.Set<ClientThreadIdRef> getClientLockSet(ClientId clientId)
          Return a set of client-threads -> ids for the given client, this is the list of objects the given client is attempting to lock, or has a lock on.
 UserLockInfo getLockInfo(ID id)
          Retrieve the user lock information (lock queue) for the given id.
 void removeClientLockReference(ClientThreadId clientThreadId, ID objectId)
          Remove a reference from a client to the given object.
 void saveLockInfo(UserLockInfo info)
          Save an updated lock information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BDbStorageEngineUserLockImpl

public BDbStorageEngineUserLockImpl(com.sleepycat.persist.EntityStore store)
Method Detail

getLockInfo

public UserLockInfo getLockInfo(ID id)
Description copied from interface: StorageEngineUserLockIF
Retrieve the user lock information (lock queue) for the given id.

Specified by:
getLockInfo in interface StorageEngineUserLockIF
Parameters:
id - The id of the lock object.
Returns:
The lock information for the given object.

saveLockInfo

public void saveLockInfo(UserLockInfo info)
Description copied from interface: StorageEngineUserLockIF
Save an updated lock information.

Specified by:
saveLockInfo in interface StorageEngineUserLockIF
Parameters:
info - The update lock information to save.

clearAll

public void clearAll()
Description copied from interface: StorageEngineUserLockIF
Clear all lock information. This includes both UserLockInfo instances and client lock information. This is generally performed at startup to ensure any old locks from previous sessions have been removed.

Specified by:
clearAll in interface StorageEngineUserLockIF

addClientLockReference

public void addClientLockReference(ClientThreadId clientThreadId,
                                   ID objectId)
Description copied from interface: StorageEngineUserLockIF
Add a reference from a client to the given object.

Specified by:
addClientLockReference in interface StorageEngineUserLockIF
Parameters:
clientThreadId - The target client thread
objectId - The object being referenced.

getClientLockSet

public java.util.Set<ClientThreadIdRef> getClientLockSet(ClientId clientId)
Description copied from interface: StorageEngineUserLockIF
Return a set of client-threads -> ids for the given client, this is the list of objects the given client is attempting to lock, or has a lock on.

Specified by:
getClientLockSet in interface StorageEngineUserLockIF
Parameters:
clientId - The target client id.
Returns:
The set of ids and client threads which are attempting to acquire them for the given client.

removeClientLockReference

public void removeClientLockReference(ClientThreadId clientThreadId,
                                      ID objectId)
Description copied from interface: StorageEngineUserLockIF
Remove a reference from a client to the given object.

Specified by:
removeClientLockReference in interface StorageEngineUserLockIF
Parameters:
clientThreadId - The target client.
objectId - The object being referenced.


Copyright © 2009. All Rights Reserved.