me.prettyprint.hector.api.locking
Interface HLock

All Known Implementing Classes:
HLockImpl

public interface HLock

A Lock whose path refers to a common path/id clients compete to acquire. Fro example: Lock("/Users/patricioe")

Author:
patricioe (Patricio Echague - patricioe@gmail.com), tnine (Todd Nine)

Method Summary
 String getLockId()
           
 HLockObserver getObserver()
          Get the observer for this lock
 String getPath()
           
 boolean isAcquired()
           
 void setLockId(String lockId)
          Sets the lock id (UID) that identifies uniquely this lock object
 void setObserver(HLockObserver observer)
          Set the observer to receive events
 void setPath(String lockPath)
          Sets the lock path for this lock.
 

Method Detail

getPath

String getPath()
Returns:
the lock path shared among all client that refer to this lock. I.e: /Users/patricioe

setPath

void setPath(String lockPath)
Sets the lock path for this lock.

Parameters:
lockPath - the lock path i.e.: /Users/patricioe or "aLockPathAllClientsWillAgreeOn"

getLockId

String getLockId()
Returns:
the lock id assigned to this lock after this lock is placed

setLockId

void setLockId(String lockId)
Sets the lock id (UID) that identifies uniquely this lock object

Parameters:
lockId - unique lock id that identifies uniquely a client. This is for internal usage only. Users don't and should not call this setter.

isAcquired

boolean isAcquired()
Returns:
whether this lock as been successfully acquired or not

setObserver

void setObserver(HLockObserver observer)
Set the observer to receive events

Parameters:
observer -

getObserver

HLockObserver getObserver()
Get the observer for this lock

Returns:


Copyright © 2013. All Rights Reserved.