org.sourceforge.jemm.database.components.interfaces
Interface DBUserLockHandler

All Known Implementing Classes:
DefaultDBUserLockHandler

public interface DBUserLockHandler

Lock handling for the MemoryDatabase.

Author:
Rory Graves

Method Summary
 void acquire(ClientThreadId threadId, ID objectId)
          Process the given thread attempting to acquire the lock in the given object.
 void clientDisconnect(ClientId clientId)
           
 void release(ClientThreadId threadId, ID objectId)
          Release the user lock on the given object
 void removeClientListener(ClientId clientId)
          Remove the lock acquire listener for the given client.
 void setClientListener(ClientId clientId, LockAcquiredListener listener)
          Sets the client callback listener for a given client.
 void shutdown()
           
 

Method Detail

removeClientListener

void removeClientListener(ClientId clientId)
Remove the lock acquire listener for the given client.

Parameters:
clientId - The client whose listener to remove.

release

void release(ClientThreadId threadId,
             ID objectId)
Release the user lock on the given object

Parameters:
threadId - The releasing thread
objectId - The id of the object

setClientListener

void setClientListener(ClientId clientId,
                       LockAcquiredListener listener)
Sets the client callback listener for a given client.

Parameters:
clientId - The client to set the callback for.
listener - The listener to call on lock events pertaining to the given client.

acquire

void acquire(ClientThreadId threadId,
             ID objectId)
Process the given thread attempting to acquire the lock in the given object. This method will return immediately. Acquire notification is handled as an asynchronous callback.

Parameters:
threadId - The requesting thread.
objectId - The object to lock.

shutdown

void shutdown()

clientDisconnect

void clientDisconnect(ClientId clientId)


Copyright © 2009. All Rights Reserved.